Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store pictures on SQL server
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01422743
Message ID:
01422745
Views:
94
>Hallo!
>What type of field should I use in an SQL-server when I want to save a Picturefile (jpg, bmp, ...))?
>
>I have tried with a fieldtype called "Image" but it dont work. When I do:
>SQLexec(nHandle,"select pic from sqltqble","Qtable") from VFP, I get the result in Qtable.pict, and thats a general field.
>
>But if I store the picturefile in a fieldtype called "Text" it will work. Then I get a memofield in VFP after the SQLselect command.
>
>I use the result like this to show the picture in a form:
>Thisform.Image.PictureVal=Qtable.pict
>
>But is it right to use the field type "Text" on the server to store pictures? It seems wrong to me.
>
>/Kjell

It depends on your SQL Server version. In SQL Server 2005 and up, you would use varbinary(max) field for this. Alternatively you may want to simply store paths to the files instead.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform