Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continued from String type + Image type Concatenation Problem [URGENT]

Status
Not open for further replies.

manum79

Programmer
Dec 14, 2005
6
US
i tried the below code

lcContent = "0x" + strconv(FileToStr(FilePath) ,15)

and tried inserting it.......it did insert the image into the table but next time when i tried to retrieve the image its giving me the following error message

OLE object is invalid or corrupted.
Unbinding object 'controlname'

i m displaying the image in an OLE object

thanks
manu
 
What Fox you use?
How you retreive data from SQL Server?
If you use VFP8 or 9 and CursorAdapter to get the data, use CursorShema and bind that field to be Memo (VFP8) or BLOB (VFP9), Do not use General Field because VFP wants additional info from that field.

Borislav Borissov
 
Hey Borislav,
Thank you very much for your imput. I am new to the FoxPro and I am not aware of using Cursor Schema. Here is the code that I am using. Please help...

WITH THISFORM
lcCurrDir = SYS(5) + SYS(2003)
lcFile = GETFILE("BMP")
IF !EMPTY(lcFile)
*** This append general is only binding for display purpose
append General tblusers.us_gsignature FROM (lcFile)
thisform.btnCancel.Enabled = .T.
thisform.btnsave.Enabled = .T.

lcContent = "0x"+STRCONV(FILETOSTR(lcFile),15)
lcsql = "Update tblusers set us_gsignature = " + lcContent + " where Us_nid =" + ALLTRIM(STR(thisform.txtnId.value))

DO sqlreturncursor WITH lcsql, "check123"
ENDIF
SET DEFAULT TO (lcCurrDir)

ENDWITH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top