binary data into MS-SQL server via ODBC

Steven sadams123 at optushome.com.au
Tue Mar 4 01:17:43 EST 2003


Could anyone provide a snippet of sample code to insert binary (image) data
into a database.

I'm current using the ODBC module on WinXP to connect to an MS-SQL Server,
the field is an 'image' type.

Inserting text works fine, however when trying to insert the data from an
image I get:

TypeError: argument 1 must be string without null bytes, not str

I'm using the the cursor.execute and giving it my own "INSERT foo (x,y,z)
VALUES (.... " SQL statements, but cannot get it to work, any help is much
appreciated (and needed)

thanks

Steven







More information about the Python-list mailing list