Sql Table with image field type

  • Thread starter Thread starter Fredrick A. Zilz
  • Start date Start date
F

Fredrick A. Zilz

I have read a number of articles and still think I am missing something.

I have a sql table with IDs and Image files of users signatures for signing Access reports as they are printed to PDF docs. I stored them in the sql database for security and to have the project contained within the database file and the adp file. So I would prefer not to use links. Using a .net windows app I can save to the table and display the images in the windows app. I use:
Dim userdat As New IHInv
Dim dr As DataRow
Dim abyt() As Byte
Dim i As Integer
i = CType(cmbBoxSign.SelectedValue, Integer)
dr = userdat.getSign(i).Rows(0)
Try
abyt = CType(dr.Item("Signature"), Byte())
Dim ms As New MemoryStream(abyt)
PictureBox1.Image = Image.FromStream(ms)
Catch
End Try
For an access report can I use memory stream? Is there a similar technique for MS access 2003?

Looking for some assistance.



Thanks

Fred
 
I have seen a couple examples using ADO 2.5 with ADODB.stream but when I try dim s as adodb.stream or dim s as stream, I get an error "user-defined type not defined.


I have read a number of articles and still think I am missing something.

I have a sql table with IDs and Image files of users signatures for signing Access reports as they are printed to PDF docs. I stored them in the sql database for security and to have the project contained within the database file and the adp file. So I would prefer not to use links. Using a .net windows app I can save to the table and display the images in the windows app. I use:
Dim userdat As New IHInv
Dim dr As DataRow
Dim abyt() As Byte
Dim i As Integer
i = CType(cmbBoxSign.SelectedValue, Integer)
dr = userdat.getSign(i).Rows(0)
Try
abyt = CType(dr.Item("Signature"), Byte())
Dim ms As New MemoryStream(abyt)
PictureBox1.Image = Image.FromStream(ms)
Catch
End Try
For an access report can I use memory stream? Is there a similar technique for MS access 2003?

Looking for some assistance.



Thanks

Fred
 
I got adodb.stream to work, I just was missing a few references in my project.
I have seen a couple examples using ADO 2.5 with ADODB.stream but when I try dim s as adodb.stream or dim s as stream, I get an error "user-defined type not defined.


I have read a number of articles and still think I am missing something.

I have a sql table with IDs and Image files of users signatures for signing Access reports as they are printed to PDF docs. I stored them in the sql database for security and to have the project contained within the database file and the adp file. So I would prefer not to use links. Using a .net windows app I can save to the table and display the images in the windows app. I use:
Dim userdat As New IHInv
Dim dr As DataRow
Dim abyt() As Byte
Dim i As Integer
i = CType(cmbBoxSign.SelectedValue, Integer)
dr = userdat.getSign(i).Rows(0)
Try
abyt = CType(dr.Item("Signature"), Byte())
Dim ms As New MemoryStream(abyt)
PictureBox1.Image = Image.FromStream(ms)
Catch
End Try
For an access report can I use memory stream? Is there a similar technique for MS access 2003?

Looking for some assistance.



Thanks

Fred
 
you can find an example here
http://accessbuho.mvps.org/ficheros/Imagenes_En_BD.zip

The documentation is in spanish, but the code is the code ;-)

The example combines resources from Eduardo A. Morcillo and Stephen Lebans.

Includes a ".tlb" developed by E. Morcillo to use Gdiplus.dll. This let us to create an StdPicture from a stream.

then, i use lebans's functions to convert this StdPicture to a Metafile

Dim stp As StdPicture

Dim imageBytes() As Byte

Set rs = New ADODB.Recordset

rs.Open "Select * From Objetos Where .", CurrentProject.Connection, .

imageBytes = rs!Objeto

Set stp = basEdanmo.LoadImage(imageBytes)

Call basStdPic.fStdPicToImageData(stp, me.CtlImagen0, False)




"Fredrick A. Zilz" <[email protected]> escribió en el mensaje I have read a number of articles and still think I am missing something.

I have a sql table with IDs and Image files of users signatures for signing Access reports as they are printed to PDF docs. I stored them in the sql database for security and to have the project contained within the database file and the adp file. So I would prefer not to use links. Using a .net windows app I can save to the table and display the images in the windows app. I use:
Dim userdat As New IHInv
Dim dr As DataRow
Dim abyt() As Byte
Dim i As Integer
i = CType(cmbBoxSign.SelectedValue, Integer)
dr = userdat.getSign(i).Rows(0)
Try
abyt = CType(dr.Item("Signature"), Byte())
Dim ms As New MemoryStream(abyt)
PictureBox1.Image = Image.FromStream(ms)
Catch
End Try
For an access report can I use memory stream? Is there a similar technique for MS access 2003?

Looking for some assistance.



Thanks

Fred
 
Back
Top