Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Hi Kirk,
I was just playing with this about a month ago for the first time and here is how I got it to work using SPT.
Use the image data type in the SQL table for storage.
To put the image into the SQL table from VFP do this:
Create a cursor in VFP with a general field, if you don't already have a table with the image in it.
Append Blank then Append General to put the image or other file into the general field.
Use SPT to do an update or insert statement.
SQLEXEC(ch,"INSERT INTO sqltable (pk,generalfield) ;
VALUES (1,?tempcursor.generalfield)")
I couldn't figure out any other way to get the image to SQL without first putting it into a table or cursor in VFP with a general field type.
To retrieve the image from SQL all I had to do was do another SPT.
SQLEXEC(ch,"SELECT * from sqltable WHERE pk = 1","Test")
I did this all from the command window and did not actually add it to an application but it did work. Double clicking the field in the VFP cursor, Test, from a browse window displayed the images after retrieving from SQL.
As I said this was my first and actually only time playing with this. If you discover any gotcha's or problems I would be interested to hear them.
HTH
John
>I need the ability to store images in the SQL Server, and display them in the application using VFP6 for the front end. I am using strictly SPT to address the database, what field type should I use on the server and is their any problem bring it back into VFP?
>
>Thanks
>
>Kirk
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement