Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Blob Datatype (getting image from SQL)...
Message
 
 
À
05/10/2007 15:24:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01259045
Message ID:
01259046
Vues:
43
This message has been marked as the solution to the initial question of the thread.
Don't use general fields. For blob see Re: How to control the contents of a Pass-through query Message #1251009.
Also you can add file to blob with APPEND MEMO
create cursor curTMP (document blob)
append blank
append memo document from getfile()
>I know two ways to store a file into sql table. First is to use in vfp a general field like this...
>
>>create cursor curTMP (document general)
>append blank
>append general from getfile()
>
>>and the second way is the following...
>create cursor curTMP (document blob)
>lcStr = FILETOSTR(getfile())
>insert into curTMP (document) values (lcStr)
>
>>and finally in both cases complete with...
>h=sqlconnect(...)
>=sqlexec(h, "insert into MySqlTable (Id, Document) values (newid(), ?curTMP.document)")
>
>That works fine!
>
>The problem is when I want to extract the document down to VFP. Then I do the following...
>=sqlexec(h, "select * from MySqlTable", "curSQL")
>=STRTOFILE(curSQL.document, "c:\MyFileFromSQL")
>
>I got the following error message...
>"OLE object is invalid or corrupted"
>
>What's wrong?
>Also in second case, the TYPE('curSQL.document') return GENERAL (not BLOB).
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform