...

View Full Version : SQL Appench Chunk



WilliamHolmes
06-28-2007, 07:04 PM
(Sorry ment to say Append Chunk)

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



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...


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

mehere
06-29-2007, 04:21 AM
run your update the same way you do your insert

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

WilliamHolmes
06-29-2007, 12:49 PM
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.:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum