sureshm
May 14th, 2001, 08:31 AM
hello,
can any body suggest how to save the images in database alternative to append chunk mechanism and stream object..or using insert statement....
thanx
Iouri
May 14th, 2001, 09:48 AM
Const MAX_PATH = 255
private Const CHUNK_SIZE = 1000
private Declare Function GetTempPath Lib "kernel32" _
Alias "GetTempPathA" (byval nBufferLength as Long, _byval lpBuffer as string) as Long
public Function SavePictureToDB(PictControl as Object, _
RS as Object, FieldName as string) as Boolean
'PURPOSE: SAVES PICTURE IN IMAGEBOX, PICTUREBOX, OR SIMILAR
'CONTROL to RECORDSET RS IN FIELD NAME FIELDNAME
'FIELD TYPE MUST BE binary (OLE OBJECT IN ACCESS)
'SAMPLE USAGE
'Dim sConn as string
'Dim oConn as new ADODB.Connection
'Dim oRs as new ADODB.Recordset''
'sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.MDB;Persist Security Info=false"'
'oConn.Open sConn
'oRs.Open "SELECT * FROM MYTABLE", oConn, adOpenKeyset, _
adLockOptimistic
'oRs.AddNew
'SavePictureToDB Picture1, oRs, "MYFIELD"
'oRs.Update
'oRs.Close
Iouri Boutchkine
iouri@hotsheet.com
LiliDi
May 17th, 2001, 09:53 AM
I have problem to save files in DB field. Can you tell me how to use stream object and can it help me. I looking for help but not found.
Thanks