General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>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.
**********************************************************
Thank you!
I use SQL server 2005.
No, I dont want to save the path. The path may not be reachable for every user. Thats why I want to save the file i a field. Its more safe.
When I upload a picture to the SQL server (to a Text field) I do like this:
APPEND MEMO Loctable.MemoField FROM Mypict.jpg
SQLexec(nHandle,"insert into sqltable (pict) values (?Loctable.MemoField")
But how do I upload to a varbinary(max) field? And how do I download it back to VFP? What type of field do I use in VFP?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only