Re: How to Save Picture

From: NR (NR_at_discussions.microsoft.com)
Date: 08/03/04


Date: Tue, 3 Aug 2004 04:45:02 -0700

SQL Statement didn't work.
I think some of the characters are comming in string which cannot be pass to SQL Server like ESCAPE.
OR
Single quote is comming in the string which creates ambiguity.

VFP Functions "FileTOSTR()" and "STRToFile()" are working properly with Foxpro Tables, need to store Picture in SQL Server table.
Would be very thankful if get my problem resolved at earliest.

"Devapriya De Silva" wrote:

> HI,
>
> You may try the following.
>
> lnCon - a connection handle to the sql server
> lcImage = FILETOSTR(YourImage.BMP)
>
> ?SQLEXEC(lnCon,"insert into pubs.dbo.pub_info1 (logo, pub_id,pr_info) values
> ('" + lcimage +"','5000','THis is my image')")
>
> data type of the Logo field is Image.
>
> Also you may see Using text, ntext, and image Functions in SQL server Books
> Online.
>
> Kind Regards,
> Devapriya De Silva
>
> "NR" <NR@discussions.microsoft.com> wrote in message
> news:C18281BB-B2C5-4E2D-93AD-E05DA4CAB8F9@microsoft.com...
> > Hi there,
> >
> > I am using VFP as front end and SQL Server as back-end database. Need to
> know, how can i save picture(embeded picture) in SQL Server table.
> > Which datatype i will have to select in VFP and what would be the SQL
> Query to save it in SQL Server's table.
> >
> >
> >
>
>
>