Page 1 of 1

COM ADODB and Inserting Binary Data into an Access Database

Posted: Tue Aug 11, 2009 2:29 pm
by izzy4505
I'm using the ADODB COM object (not this ADOdb PHP class I see on Sourceforge) to connect to an MS Access 2000 database. I have a need to dump about 3-6KB of binary data into a field while inserting. I've tried escaping any ' in the data and putting it in with a standard INSERT query within $conn->Execute(), but I get the error "Syntax error in string in query expression ''ÿØÿà'.'". Looks like it's choking on my binary data for some reason.

Is there a better way to escape my data? Does ADODB provide a method for escaping things properly, similar to the mysql_escape_string() function?

Alternatively, I understand that there is a way I can build a recordset object and insert this object into my database. I remember doing this with ADODB in VB back in the day, but I can't find any of my old code. Any ideas on how to do this?

Many thanks in advance.