Page 1 of 2 12 LastLast
Results 1 to 40 of 61

Thread: This may interest some of you!! Storing any File type in a database!

  1. #1

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Wanna play music from the db!

    This is a simple demo.
    Add the media player control(mp1), a text box(txtfile) and another 2 command buttons(cmdGet and cmdPlay) to the above code etc.

    IMPORTANT: you gotta add a field called filename and a text box called txtfilename as well. The make changes to cmdadd and fillfields subs.

    I done it for ya coz i'm so noice!
    VB Code:
    1. Public Sub FillFields()
    2.     If Not (rs.BOF And rs.EOF) Then
    3.         txtDescription.Text = rs.Fields("Description")
    4.         txtfilename.Text = rs.Fields("filename")
    5.     End If
    6. End Sub

    ADD NEW CODE:

    VB Code:
    1. Private Sub cmdAdd_Click()
    2.     Dim bytData() As Byte
    3.     Dim strDescription As String
    4.     On Error GoTo err
    5.    
    6.     With dlgadd
    7.        
    8.         .Filter = "All Files (*.*|*.*"
    9.         .DialogTitle = "Select File"
    10.         .ShowOpen
    11.  
    12.        
    13.         Open .FileName For Binary As #1
    14.         ReDim bytData(FileLen(.FileName))
    15.         If FileLen(.FileName) > "1000000" Then
    16.         MsgBox "This is a large file it could take some time! Please be patient!!!", vbInformation, "Large File"
    17.         End If
    18.     End With
    19.    
    20.     Get #1, , bytData
    21.     Close #1
    22.    
    23.     Dim fn As String
    24.     fn = dlgadd.FileName
    25.     strDescription = InputBox("Enter description.", "New Picture")
    26.    
    27.     With rs
    28.     DoEvents
    29.     Me.MousePointer = 11
    30.         .AddNew
    31.         .Fields("filename") = fn
    32.         .Fields("Description") = strDescription
    33.         .Fields("File").AppendChunk bytData
    34.         .Update
    35.     DoEvents
    36.     End With
    37.     Me.MousePointer = 0
    38.     FillFields
    39.     Exit Sub
    40. err:
    41.     If err.Number = 32755 Then
    42.         Me.MousePointer = 0
    43.     Else
    44.     Me.MousePointer = 0
    45.         MsgBox err.Description
    46.         err.Clear
    47.     End If
    48. End Sub

    Now on cmdGet

    VB Code:
    1. Private Sub cmdGet_Click()
    2.  
    3.             'check for temporary file if it's found delete it
    4.             temp = App.Path & "\" & txtfilename.Text
    5.             If Len(Dir(temp)) > 0 Then
    6.                 Kill temp
    7.             End If
    8.  
    9.             'Open temp file
    10.             file = FreeFile
    11.             Open temp For Binary As #file
    12.  
    13.             'Read temp file as binary into chunk
    14.             'this is the engine room
    15.             ImgeSze = rs("FILE").ActualSize
    16.             Do While offset < ImgeSze
    17.                chunk() = rs("FILE").GetChunk(ChunkSize)
    18.                Put #file, , chunk()
    19.                offset = offset + ChunkSize
    20.             Loop
    21.  
    22.             Close #file
    23. txtfile.Text = temp
    24. 'this is to load it's path name into the text box
    25. End Sub
    Then on cmdPlay
    VB Code:
    1. Private Sub cmdPlay_Click()
    2. 'get filename
    3. mp1.FileName = txtfile.Text
    4. mp1.Play 'play it
    5. 'Please modify the below line so when it's finished playing it, it 'deletes the file it made! At the moment it'll work but you'll get an error
    6. Kill txtfile.Text 'kill it
    7. End Sub
    It just uses the temp file we make when retrieving the file out of the database and plays it then deletes it when finished playing.

  2. #2

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    If you get E_fail or E_Size errors then:

    1) Get mdac 2.6 not 2.5 for e_fails

    and
    2) Make sure all fields are memo except autonumber and ole fields!
    Last edited by Beacon; Nov 21st, 2001 at 10:10 PM.

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    There are different kinds of databases that allow unlimited length in the memo field.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    timekiller
    Guest
    Beacon,

    I got it to work by changing my datatype to my field from Binary to Image. Very nice!

    I also found that this will work as well using Stream (ADO 2.5+, SQL 7.0):

    Dim mstream As ADODB.Stream
    Set mstream = New ADODB.Stream
    mstream.Type = adTypeBinary
    mstream.Open

    mstream.LoadFromFile sFile
    rs.Fields("yourfieldhere").Value = mstream.Read

    rs.Update

    '--------------------------------------------------

    Set mstream = New ADODB.Stream
    mstream.Type = adTypeBinary
    mstream.Open

    'read from db recordset
    mstream.Write rs.Fields("yourfieldhere").Value

    'write to file
    mstream.SaveToFile "yourpathfilenamehere", adSaveCreateOverWrite


    No need to chunk

  5. #5
    Addicted Member
    Join Date
    Sep 2000
    Posts
    230
    Any one know what the max size of an ole object field is in Access. My program (beacons) program works until I try to read a large file into th database, then I get an "E_Fail" error from the provide. I dont even know what an E_Fail error is?
    Shawn Hull
    VB6, SP3 (Professional Edition)

  6. #6
    Addicted Member
    Join Date
    Sep 2000
    Posts
    230

    Talking

    I found the problem, or at least a simple solution. I tried the exact same code, but instead used DAO as the database driver and guess what it worked fine. So it seems that the problem is in the ADO driver, not the size of the field (although there is a1 GB limit as you mention). Also I found a clever way with the help of your code to not only store any file the database, but also view any file in the OLE Container field once it is stored as long binary data in the database (I am doing this so any file can dropped into my OLE box can be stored then viewed later.

    The problem I found with storing long binary data is that unless you know the type, you just have binary data, i.e. you dont know what kind of file it is. This poses a problem when trying to view ANY file that is stored as long binary data.

    The method is simple, use the ole box to do the dirty work. When some one drops an object into the ole box, have the ole box 'SavetoFile'. By doing this, eveything is stored in the binary data, including the object header (now we will always know the type of file stored.) Once the ole box savetofile method has been completed, read the saved file into the database as long binary data using the appendchunk method as you showed. To view any object, Simple write the data from the long binary field to a file named .OLE, and use the ole box's readfromfile method. This method allows the ole box to do all the hardwork and the programmer does not have to worry about storing a file extension or object type with the long binary data. Hope this helps and if any needs the code, I will provide it.
    Shawn Hull
    VB6, SP3 (Professional Edition)

  7. #7
    Addicted Member
    Join Date
    Sep 2000
    Posts
    230
    Here it is. It needs cleaned up but it works. Let me know if you have questions.

    Code:
    Dim RS As ADODB.Recordset
    Dim db As Database
    Dim rsdao As Recordset
    
    
    Private Sub Form_Load()
    
    ConnecttoDB 'connection function for ado stuff
    
    Set RS = New ADODB.Recordset 'Ado rs
    RS.Open "Select * from tblTemp", NRGConnection, adOpenDynamic, adLockOptimistic, adCmdText
    
    
    Set db = OpenDatabase(App.Path & Nuregdbname)
    
       
    Set rsdao = _
          db.OpenRecordset("Select * from tbltemp", _
          dbOpenDynaset)
       
          'tblTemp contains an ole field named "Longdata" 
    
    End Sub
    
    Private Sub Save_Object_to_Recordset()
    'Save object in the ole box to the rs
    
    Dim bytData() As Byte
    Dim strDescription As String
    Dim FileNum As Integer
    
    
    On Error GoTo err
    
    Dim t As String
    t = "c:\t.ole"
    If Len(Dir(t)) > 0 Then
    Kill t
    End If
    
       
    ' Get file number.
    FileNum = FreeFile
    ' Open file to be saved.
    Open t For Binary As #FileNum
    ' Save the file.
    OLE1.SaveToFile FileNum 'Save ole object to file
    ' Close the file.
    Close #FileNum
       
    
    
    
    
    
    Open t For Binary As #1 'Open saved file
    
    
    'Get data from saved file
    ReDim bytData(FileLen(t))
    Get #1, , bytData 'Get data
    Close #1
    
    
    
    
    'Put in rs at current row
    With rsdao
        .Edit
        .Fields("LongData").AppendChunk bytData
        .Update 'ADO fails here for large files.
    End With
    
    Exit Sub
    
    err:
    
    MsgBox err.Description & "  " & err.Number
    err.Clear
    
    
    End Sub
    
    Public Sub Display_Ole_Object_From_Recordset()
    
    Dim imgsze As Long
    Dim offset As Long
    Dim chunk() As Byte
    Dim file As Integer
    Const ChunkSize = 32768
    Dim FileNum As Integer
    Dim t As String
    'Make sure the temporary file does not already exist
    
    t = "c:\t.ole"
    If Len(Dir(t)) > 0 Then
    Kill t
    End If
    
    'Open temp file and write the db contents
    file = FreeFile
    Open t For Binary As #file
    imgsze = RS("longdata").ActualSize 'Get field size from rs
    Do While offset < imgsze
    chunk() = RS("longdata").GetChunk(ChunkSize) 'Extract the data
    Put #file, , chunk()
    offset = offset + ChunkSize
    Loop
    Close #file
    
       
    ' Get file number.
    FileNum = FreeFile
    ' Open file to be read by the ole
    Open t For Binary As #FileNum
    ' Save the file.
    OLE1.ReadFromFile FileNum 'Insert file into ole box
    ' Close the file.
    Close #FileNum
    
    MsgBox "Object inserted."
    
    End Sub
    You can ignore the ADO stuff.
    Shawn Hull
    VB6, SP3 (Professional Edition)

  8. #8

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    If anyone has the same problem as A2427. I.e

    "Any one know what the max size of an ole object field is in Access. My program (beacons) program works until I try to read a large file into th database, then I get an "E_Fail" error from the provide. I dont even know what an E_Fail error is?"

    The answer is you need to go get ADO 2.7 Library from microsofts website!

  9. #9
    Junior Member
    Join Date
    Nov 2001
    Location
    Victo, Québec, Canada
    Posts
    30
    can u shoe me hoe to put something like 500 .jpg files in ONE file?

  10. #10
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50
    I can't shoe you a thing!!
    Jim

    "...head is all empty and I don't care..."

  11. #11
    Banned Motxopro's Avatar
    Join Date
    Dec 2001
    Posts
    57
    yeah it interests me

  12. #12
    Jethro
    Guest
    Originally posted by Beacon
    Nah got me mate megatron to do that i just said delete all jethro's posts and he said ok!
    So that's why all my threads have disappeared, including the one detailing how to export data at the speed of light....damn hope l keeped some notes on that one

  13. #13
    Lively Member
    Join Date
    Oct 2001
    Location
    asia
    Posts
    87
    this example is great. but y i need to store it in db?

  14. #14

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Ok i'll answer this with a question.

    Why do you store text and number etc. in a database?
    Same reason. Alls this code does is stores and retrieves numbers(binary data) in a database.

    later
    b

  15. #15
    Jethro
    Guest
    Originally posted by ZUWARI
    this example is great. but y i need to store it in db?
    Er...to access it later....Security codes etc.

  16. #16
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    "Unspecified Error"

    I just got an unspecified error!!!! on the following code:

    Why???

    Code:
    Dim db As Connection
    Dim rs As Recordset
    
    Private Sub LoadDriverBase()
    Dim db As Connection
        Set db = New Connection
            db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Drivers\DriverBase\DrBase.mdb;Persist Security Info=False"
        
        Set rs = New Recordset
            rs.Open "Select * From Zipped", db.ConnectionString, adOpenStatic, adLockOptimistic
            
    End Sub
    
    Public Sub FillFields()
        If Not (rs.BOF And rs.EOF) Then
            txtDescription.Text = rs.Fields("Description")
            txtfilename.Text = rs.Fields("filename")
        End If
    End Sub
    
    Private Sub cmdAdd_Click()
        Dim bytData() As Byte
        Dim strDescription As String
        'On Error GoTo err
        
        With dlgadd
            
            .Filter = "All Files (*.*|*.*"
            .DialogTitle = "Select File"
            .ShowOpen
     
            
            Open .FileName For Binary As #1
            ReDim bytData(FileLen(.FileName))
            If FileLen(.FileName) > "1000000" Then
            MsgBox "This is a large file it could take some time! Please be patient!!!", vbInformation, "Large File"
            End If
        End With
        
        Get #1, , bytData
        Close #1
        
        Dim fn As String
        fn = dlgadd.FileName
        strDescription = InputBox("Enter description.", "New Zipped File")
        
        With rs
        DoEvents
        Me.MousePointer = 11
            .AddNew
            .Fields("FileName") = fn
            .Fields("Description") = strDescription
            .Fields("Zipped").AppendChunk bytData
            .Update
        DoEvents
        End With
        Me.MousePointer = 0
        'FillFields
        Exit Sub
    err:
        If err.Number = 32755 Then
            Me.MousePointer = 0
        Else
        Me.MousePointer = 0
            MsgBox err.Description
            err.Clear
        End If
    End Sub
    
    Private Sub Form_Load()
    LoadDriverBase
    End Sub

    THanx for any help!!!

    ~Squirrelly1

  17. #17

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Where is the error?

    What line?

    Oh also note that code is for ADODB? Not dao not that it should matter but there maybe some functions in there that dao wont like!
    It was an extension of my image_library one!

    later
    b

  18. #18
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    ...

    Beacon,

    First of all, thank you for replying...

    The error was in the line..
    Code:
    .Fields("Zipped").AppendChunk bytData

    It says that it is an "Unspecified Error"...

    The Field name is correct, and I am using ADODB...

    The library I am using is the Microsoft ActiveX Data Objects 2.1 Library. Could you attach the latest library to your next post... Maybe that's the problem.

    Also, if you have time...
    Could you put together a 'very simple' (I don't want to waste your time) sample program that will put .exe's into a dbase...

    As you can see, I've tried to do this with the code posted here, but I've been quite unsuccessful as of yet.


    Thank you for your time,

    Squirrelly1

  19. #19
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    2.7 library

    I downloaded the 2.7 library, and still no change.... I'm going to try and start over again and see if I just forgot something last time...


    Please help, beacon...


    thanx,
    Squirrelly1

  20. #20

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Ok i'll whack a crappy example together for you! Sorry it was a public holiday over here!

    But till then i note you arent using ADODB code more dao type code:
    Note: This was an extension to my image library tutorial.

    In your declarations it should be:
    VB Code:
    1. Private cn As ADODB.Connection
    2. Private rs As ADODB.Recordset

    This is how you set the connection:
    VB Code:
    1. Set cn = New ADODB.Connection
    2.     cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    3.       "Data Source=" & App.Path & "\files.mdb"
    4.     cn.Open
    5.     Set rs = New ADODB.Recordset
    6.     rs.Open "table1", cn, adOpenKeyset, adLockPessimistic, adCmdTable

    Alter you code accordingly!!!
    later
    b

  21. #21

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    An example for ya!

    This example was from when i was working out how to do it so it's real crap and basic. It works however but it's slow, looks crap and even the database is real simple.

    I dont like posting stuff that aint up to standard but i dont have time to write comments and stuff for a more complex one!

    Anyway hope it makes sense and helps!
    later
    b
    Attached Files Attached Files

  22. #22
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Hi

    Beacon - nice coding. Anyway - what is the definition of MP1 in the play music from DB ?

    Regards

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  23. #23

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Ok sorry bit lost what do you want to do??
    You want to identify that it's an MP1 file yes/no?


    later
    b

  24. #24
    Member
    Join Date
    Mar 2002
    Posts
    35
    Beacon,

    Does it mean that with your codes to save any files to database that I can do the following:

    First of all, the user selects a file from a server and can insert the selected file into an attribute in the database. And that after insterting the file into the database, the user can in the future work on the file that is in the database? When the file is open for editing, it is not longer reflected/updated to the file in the server? Which means, the file in the database is no longer asociated/linked to the file in the server.

    Can the codes that you've written support that? Hope you're able to understand what i'm talking about =)

    Thanks for your advice!!!

  25. #25
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Hi

    Originally posted by Beacon
    Ok sorry bit lost what do you want to do??
    You want to identify that it's an MP1 file yes/no?


    later
    b
    I was looking at the second chunk of coding at the top - said mp1 in the code and I couldn't see where it was defined. Just did a search though for mp1 and you've stated its a Media Player control sooooooooooo Sorry

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  26. #26

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Vince:
    hehe sorry crappy names but it was a test!


    FusedOut:
    Yes. Why??

  27. #27
    Member
    Join Date
    Mar 2002
    Posts
    35
    so Beacon,

    do i save all the information by using Appendchunk method? how do i get back my image after its saved to the database? can you show me the codes to do it?

    Thanks :-)

  28. #28

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Nope!

    Read the top thread there's a tutorial i wrote for saving images into a database and getting em back out.
    Download it and read it and you'll know how.

    later
    b

  29. #29
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    Talking THANK YOU THANK YOU THANK YOU

    Beacon,

    First of all, that is some awesome code!!! It's going to help me a lot... and thnx for the example, I checked it out and it's cool (I'll examine what I did wrong in a little bit)

    Thanks a million,

    Squirrelly1
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

  30. #30

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    no probs let me know!
    later
    b

  31. #31
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    Arrow I was wrong

    Beacon,
    I was wrong, the example didn't exactly work for me.... I created a test .txt file and put some string into it... I think it was "This is a test" or something like that.... I had no trouble getting it into the database, but when I tried to save it to another name from the database, it gave me an error...

    Code:
    Either BOF or EOF is true.... la di da di da
    the error was in the savefile sub on this line...

    Code:
    imgsze = rs("file").ActualSize
    I checked out the created file anyway, and it was empty instead of containing my string...

    thanks beacon...

    Squirrelly1

  32. #32
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    streaming

    Beacon,

    have you tried to do this with streaming????

    I wonder if that would be faster????

    Squirrelly1
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

  33. #33

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Hey squirrelly1

    Nope i havent tried streaming it! I wondered that myself but havent had the time to test it.
    Over the next few days i'll see what i can do if i have time!

    Ok it has no checks in it for eof or nothing i dont think.
    The codes doesnt work if you loop the savefile sub but i dont think you doing that.
    Though you may be at the EOF so you'll need to make sure the recordset is at the record you want.

    Are you using the code in that attachment??
    If so gimme 45mins and i'll be able to download it and test it.

  34. #34
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    yep

    Yep, I'm using the example you gave... it is the one w/ the error

    I'm probably wrong, but i think the error is in that you don't seem to have any code that tells the program where to look in the db...

    for example...

    you tell it to look in rs("file)... but how does it know which one of the files you want to save if you have multiple files in the database?

  35. #35

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    yeah whoops i kinda through that one together sorry.

    Basically you gotta find out what record you want.
    This isnt the most efficient way or the fastest but it works:

    Also i altered the progress bar code so it's better!!

    VB Code:
    1. Public Sub savefile()
    2. pb1.Value = pb1.Min
    3. cd1.Filter = "All Files (*.*) |*.*" 'only allow gifs
    4. cd1.DialogTitle = "Save File"
    5. cd1.FileName = lstfilename.Text
    6. cd1.ShowSave 'show save dialog box
    7.  
    8.             Dim imgsze As Long
    9.             Dim offset As Long
    10.             Dim chunk() As Byte
    11.             Dim file As Integer
    12.             Dim temp As String
    13.             Const ChunkSize = 100
    14.             Dim X As Integer
    15.            
    16. 'what record are we at
    17.         rs.MoveFirst
    18.         X = 0 'or 1 if using list view or treeview!
    19.         Do Until X = lstfilename.ListIndex
    20.         rs.MoveNext
    21.         X = X + 1
    22.         Loop
    23.            
    24.             'Make sure the temporary file does not already exist
    25.             temp = cd1.FileName
    26. If Len(Dir(temp)) > 0 Then
    27.                 Kill temp
    28.             End If
    29.             'Open temp file
    30.             file = FreeFile
    31.             Open temp For Binary As #file
    32.  
    33.             'Read temp file as binary into chunk
    34.             'this is the engine room
    35.             imgsze = rs("file").ActualSize
    36.             pb1.Max = imgsze
    37.             Do While offset < imgsze
    38.                chunk() = rs("file").GetChunk(ChunkSize)
    39.                Put #file, , chunk()
    40.                offset = offset + ChunkSize
    41.             If imgsze < offset Then
    42.             pb1.Value = pb1.Max
    43.             Else
    44.             pb1.Value = offset
    45.             End If
    46.             Loop
    47.             Close #file
    48.  
    49. MsgBox "Save Complete", vbInformation, "Save:"
    50. End Sub
    Last edited by Beacon; Mar 21st, 2002 at 01:11 AM.

  36. #36
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    Awesome!

    This is really awesome Beacon... You certainly are a master at your craft...

    But I did find one little thing...

    when you put in the record finding bit... you set X to equal 1, but it needs to be 0.... Just a little thing, but it makes a big difference!!!

    Thanks again,
    Squirrelly1

  37. #37

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    yeah whoops i was testing with a treeview!
    hehe
    I'll go change it thanks!

    b

  38. #38
    Dimension
    Guest
    what do i have to reference to make this work?

  39. #39

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Microsoft Active Data Objects 2.x

    If your confused about ado read my tutorial on it!!

    later
    b

  40. #40
    Member
    Join Date
    Mar 2002
    Posts
    35
    erm Beacon....

    How do I update the field that is of OLE Object datatype?
    Do I have to delete the content in there first and then insert it in?

    I'm doing the sql code wrongly...and it is deleting the record instead of just the content in the field.

    Here's my sql code for that:
    sql = "DELETE FileInfo.Comments FROM FileInfo WHERE FileInfo.FileName = '" & selectedFile & "'"

    Or can I do it this way? Its wrongly done too...
    sql = "UPDATE FileInfo SET Comments = " & "rst.Fields(Comments).AppendChunk strdata " & "WHERE FileInfo.FileName =" & selectedFile


    Can you please help me with this? Thank you very much!

Page 1 of 2 12 LastLast

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