Store Images in a Database

Version
1.0

Introduction

I have seen lot of queries about “How to insert an image into database as well as retrieve an image from database?” at Developer Fusion’s forum. I have developed an “ActiveX DLL” which will work on Microsoft Access Database.

The name of that ActiveX DLL is “ADOPictDB32.dll”. ADOPictDB32.dll one Sub Procedure and one Function

  • putPict(ADODB.Recordset, Database Fieldname, Temporary Filename)
  • getPict(ADODB.Recordset, Database Fieldname, Temporary Filename) as String

Here putPict is the Sub Procedure, which takes an ADODB.Recordtset object as 1st argument, Database Fieldname in which the picture will be held as 2nd argument and the temporary filename as 3rd argument (this will held the picture file temporarily). The Sub Procedure putPict is used to put picture into database.

getPict is a Function which takes 3 arguments same as putPict () Sub Procedure but return the filename. getPict is used to get picture from database. The Database Type is Microsoft Access

The Database structure that I have used is given below

Field nameData type
PidAuto Number
PictOLE Object

You must add ADOPictDb32.dll as Reference to the Project.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan