ole object in access database.........
-
Hi All, I am using access database and vb 6.0 in my application. I want to store image/excel file for this purpose i decide to use OLE object datatype of access.But could not get sample code for my purpose. If anyone know any link please pass to me. Thanks, Nagraj
-
Hi All, I am using access database and vb 6.0 in my application. I want to store image/excel file for this purpose i decide to use OLE object datatype of access.But could not get sample code for my purpose. If anyone know any link please pass to me. Thanks, Nagraj
It's been a long time since i stop using my vb6. Now i'm using vb2005. You can store many kind of file into your OLE object field. THe concept is: First, you need to read all bytes of your file and put it into an array of bytes. Last, then you can store this array into your OLE Object. Simple isn't it?:laugh: In VB2005 you can do this with a line of code: -------------------------------------------------------------- Imports System Import System.IO Class Streamer 'It will return array of bytes. Public Function GetByteArrayFromFile(ByVal FileName As String) As Byte() Return File.ReadAllBytes(FileName) End Function 'It will make the file form array of bytes. Public Sub MakeFileFormByteArray(ByVal FileName As String, ByVal ByteStream As Byte()) File.WriteAllBytes(FileName, ByteStream) End Sub End Class -------------------------------- You need to make the routine to retrieve and store the data by your own. I believe you can do that. If anyone can convert it to vb6? Plz Helo him Thanks before