Hi All,
I'm using ADO (VB 6.0) to try and insert and update an image to a mysql database. However i'm having problems doing this coz sometimes it updates only once and with every subsequent effort to update this column i get the following error : Run-time error '-2147467259(80004005)';
Data provider or other service returned an E_FAIL status
Or it just doesn't update and keep's on giving me the above error;


And the following is my code:
Dim con as new adodb.connection
Dim rs as new adodb.recordset
dim mytream as new adodb.stream
rs.open "select * from tbl_picture where id=1", con, adOpenKeyset, adLockOptimistic
mystream.open
mystream.loadfromfile "c:\image.jpeg"
rs!my_picture=mystream.read
rs.update
mystream.close
rs.close


N/B: I'm using mysql ODBC driver is version 3.51

Any Help towards solving this is highly appreciated.

What version of MDAC are you using?

Also Google for:

adExecuteNoRecords

This should suppress the error and allow the update to continue but you should really find out the root cause.

Chances are you are using old data connector.

IE MDAC 2.6 with .NET 2.0 etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.