I have a BMP Image I want to insert into an SQL varbinary(max) field. I came up with this code:
When I execute this, I get the error: "Unclosed quotation mark after the character string 'BM -- That suggests to me the code is trying to insert the FileToStr string and not jcBMP. If I look at the jcBMP string interactively in VFP, it looks like hex. But if I do a StrToFile(M.jcBMP, "I:\Out.txt", 0), it has the "BM" characters at the beginning that BMP images do.
Any suggestions? Am I missing an environment setting? What am I doing wrong?
Code:
Store Cast(FileToStr(Pic.bmp) As Blob) To jcBMP
CursorSetProp('MapBinary', .T., 0)
SQL_Status = SQLExec(SQL_Connection, "INSERT Into SFile (BMPField) Values (' + M.jcBMP + "');")
When I execute this, I get the error: "Unclosed quotation mark after the character string 'BM -- That suggests to me the code is trying to insert the FileToStr string and not jcBMP. If I look at the jcBMP string interactively in VFP, it looks like hex. But if I do a StrToFile(M.jcBMP, "I:\Out.txt", 0), it has the "BM" characters at the beginning that BMP images do.
Any suggestions? Am I missing an environment setting? What am I doing wrong?