Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving Binary File to/from SQL*Server
Message
 
 
À
05/11/2001 11:24:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00577111
Message ID:
00577824
Vues:
22
Hi!

>Vlad,
>What I said is explanatory. You can store binary data (like zip) to SQL server image datatype and can retrieve it. As far as I could see faq#7995 already updated. When I wrote my message it clearly had :
>
>"Image field on SQL Server mapped to general field in VFP, causing no way to use image field just to store binary data, for example, ZIP file."
>
>Really I didn't know I could update it and would never update someone else's document.
>

I did not knew too until recent changes in UT interface. Of course, this probably require some rules, like at the Wiki site...

>For write part I would do something like this (Image datatype) :
>
>*Write
>create cursor temp (DataFile g)
>append blank
>append general DataFile from (getfile())
>SQLEXEC(lnHandle,"insert into tablename (f1,f2,ImageField) values ('VarChar','VarChar',?Temp.DataFile)")
>use in 'Temp'
>*Read
>SQLEXEC(lnHandle,"select * from tablename")

Cetin, above way you save file as a content of General field. BUT, how you will read it and get the file back to disk??? When talking about universal approach (saving ANY document type in image field in SQL Server), APPEND GENERAL result is quite different for different file types. Do you know a *universal* way to extract that file from General field after APPEND GENERAL ... FILE ... command? There are not reverse command, and I did not found uniiversal aproach but approach for bitmaps only based on extracting phisycal content of General field (the same way as in my approach - converting it to memo) starting from the certain offset byte. Just compare - my approach puts just a file in a general field, when your - file with some other information required for correct General field formatting. The approach I talked about is for working with plain files, not files in General fields.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform