Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help updating a record with image type

Status
Not open for further replies.

hoggle

Programmer
Joined
Jul 13, 2001
Messages
124
Location
US
I'm have my table fill rows with data before I can put in the image, so I have to go back later in my vb6 program to update my sql2000 table. When I try to use this code it says update isn't allowed in this lock type...

sqlConnection.Open "DataBASE", "user", "password"
sqlRecord.Open "DataBASE_FileCollection", sqlConnection, adOpenDynamic, adLockOptimistic, adCmdTable
'I get my image into a byte array here
Open PathName For Binary As #1
ReDim bytData(FileLen(PathName))
Get #1, , bytData
Close #1
'then I try to update the database here
dbStatement = "SELECT * FROM DMBASE_FileCollection WHERE FileName = '" & FName & "' "
Set sqlRecord = sqlConnection.Execute (dbStatement)
sqlRecord.Fields("Thumbnail").AppendChunk bytData
sqlRecord.Update
sqlRecord.Close

I'm completely stuck on this if anyone can tell me what I'm doing worng, or another way to do it I'd be very happy :)
thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top