<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000080>Yes, it should be</FONT><FONT color=#000000>:
image_blob = open(image_file, 'rb').read()</FONT></DIV>
<DIV><FONT color=#000080><FONT color=#000080></FONT></FONT> </DIV>
<DIV><FONT color=#000080><FONT color=#000000>Thank-you!</FONT></DIV>
<DIV><BR> </DIV></FONT>
<DIV style="FONT: 10pt arial">----- Original Message -----
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A
title=bgailer@alum.rpi.edu href="mailto:bgailer@alum.rpi.edu">bob gailer</A>
</DIV>
<DIV><B>To:</B> <A title=dineshbvadhia@hotmail.com
href="mailto:dineshbvadhia@hotmail.com">Dinesh B Vadhia</A> </DIV>
<DIV><B>Cc:</B> <A title=tutor@python.org
href="mailto:tutor@python.org">tutor@python.org</A> </DIV>
<DIV><B>Sent:</B> Saturday, November 24, 2007 5:55 PM</DIV>
<DIV><B>Subject:</B> Re: [Tutor] error binding parameter 1</DIV></DIV>
<DIV><BR></DIV>Dinesh B Vadhia wrote:<BR>> Hello! Can anyone see what
the problem with this code snippet is?<BR>> <BR>>
Dinesh<BR>> <BR>>
------------------------------------------------------------------------<BR>>
image_filename =
str(dir_list[i])<BR>>
image_file = dir_path +
image_filename<BR>>
image_blob = open(image_file, 'rb')<BR>Should that be<BR>image_blob =
open(image_file, 'rb').read()?<BR>> [L40] cursor.execute("Insert
into image_table values (?, ?)", <BR>> (image_filename,
image_blob))<BR>> <BR>> Traceback (most recent call
last):<BR>> File "C:\storage management.py", line 40, in
<module><BR>> cursor.execute("Insert into
image_table values (?, ?)", <BR>> (image_filename, image_blob))<BR>>
InterfaceError: Error binding parameter 1 - probably unsupported type.<BR>>
------------------------------------------------------------------------<BR>><BR>>
_______________________________________________<BR>> Tutor maillist
- <A href="mailto:Tutor@python.org">Tutor@python.org</A><BR>> <A
href="http://mail.python.org/mailman/listinfo/tutor">http://mail.pythonorg/mailman/listinfo/tutor</A><BR>>
<BR><BR></BODY></HTML>