Vassilis Aggelakos wrote:

Hi all,

As I wait Whil's new book about MySQL Server I tried to create a test database and I crashed on the wall many times

1. I create a table t with a MEDIUMBLOB field named PhotoField for storing some photographs.
   Typing in the command window:
   lcPhoto = Filetostr("c:\myphoto.jpg")
? SQLEXEC(1, "insert into t (rec_id, PhotoField) values (1, " + lcPhoto + ")" )
  I get an error saying that my syntax is not correct.

Does anyone know how this can be accomplished?

Try this:
? SQLEXEC(1, [insert into t (rec_id, PhotoField) values (1, "] + lcPhoto + [")] )

You might try and build the string first so you can check it out in the debugger, too:
lcSQL = [insert into t (rec_id, PhotoField) values (1, "] + lcPhoto + [")]
strtofile(lcSQL,"mysql.txt")
? SQLEXEC(1, lcSQL)

If that doesn't work, then I'm guessing that the string result from your FileToStr() call has a double quote in it somewhere?

Can't advise you on the other two questions...sorry!


--
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to