If i remove the adCmdTable parameter then the statement will process but the adOpenKeyset and adLockOptimistic settings will be default and not as specified. As i am trying to update a value in the table, the default settings are read only so i get an error relating to be unable to update due to lock state.
DB Version: SQL Server 12
Table: the blob table has the ID column set as the primary key
BLOB field type is image
the adCmdTable parameter is correctly being returned as int 2.
Here is the code i am trying to run.
Dim OpenResConn, sql, sFileName, adoRS, iDriverID
iDriverID = 4
sFileName = "C:\Testing\Errors\TestUncertain.png"
Set OpenResConn = Sys.OleObject("ADODB.Connection")
Re: ADODB - Syntax error when trying to open a recordset when using the adCmdTable parameter
Solved the first problem in that asCmdTable returns all the columns associated with the table, as i only need 1 columns not passing it as a parameter is a viable option which allows the script to continue...
Unfortunately i have now come across another issue relating the to ADODB.Stream
Set adoSt = Sys.OleObject("ADODB.Stream")
adoSt.Type = 1'adTypeBinary
'Write the stream to the recordset and update it
adoRs.Fields("BLOB").Value = adoSt.Read
I get a type mismatch when i read the value back to the record set (the file is a .png)