Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation SQL Appench Chunk

    (Sorry ment to say Append Chunk)

    Hi im using the following code to add a new record...

    Code:
    Dim rs
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open "comingup", connStr, 2, 2
    rs.AddNew
    
    rs("File Data").AppendChunk fileData
    rs("Content Type") = contentType
    rs("File Size") = fileSize
    rs("Title") = FTitleInput
    rs("Date") = (day(FDateInput)&"/"&month(FDateInput)&"/"&year(FDateInput))
    rs("SmallDescription") = FDescriptionInput
    					
    rs.Update
    This works perfectly BUT what do i need to now is update a record.
    So i tried...
    Code:
    rsE.Open "Update comingup SET [Date]='"&(day(FDateInput)&"/"&month(FDateInput)&"/"&year(FDateInput))&"', [Title]= '"&FTitleInput&"', [File Size]="&fileSize&", [File Data]='"&fileData&"', [Content Type]='"&contentType&"', [SmallDescription]='"&FDescriptionInput&"'  where [ID] = "&Cint(eventID), connStr
    Its the FileData that is the problem. Its is of type OLE Object in MS Access.

    Any ideas ?? Thanks
    Last edited by WilliamHolmes; 06-28-2007 at 08:23 PM.

  • #2
    Regular Coder
    Join Date
    Jan 2005
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts
    run your update the same way you do your insert
    Code:
    Dim rs
    Set rs = Server.CreateObject("ADODB.Recordset")
    strSQL = SELECT * FROM comingup where [ID] = "&Cint(eventID)
    rs.Open strSQL, connStr, 2, 2
    
    rs("File Data").AppendChunk fileData
    rs("Content Type") = contentType
    rs("File Size") = fileSize
    rs("Title") = FTitleInput
    rs("Date") = (day(FDateInput)&"/"&month(FDateInput)&"/"&year(FDateInput))
    rs("SmallDescription") = FDescriptionInput
    					
    rs.Update

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks

    Thanks for the help... i had tried that but left the rs.AddNew where it was.

    Anyway i found a small work around which worked well.

    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
    •