CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2000
    Posts
    24

    saving images in database

    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


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: saving images in database

    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
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Oct 2000
    Posts
    30

    Re: saving images in database

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured