Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving Binary File to/from SQL*Server
Message
From
05/11/2001 11:24:49
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00577111
Message ID:
00577402
Views:
24
>>>IMHO faq#713 is outdated or is incorrect ? I can store and read ZIP to SQL server image datatype.
>>>
>>>I'm curious, what did you find outdated or incorrect in this faq#?
>>
>>"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."
>>
>>I can store and retrieve zip files to Image datatype easily. Either using SQL pass through or RVs.
>
>Would you like to explain more, or write a comment to that FAQ? This topic appears VERY often at several sites.

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#713 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.

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

>>
>>>
>>>Maybe Vlad was referring the complexity of doing that via SQL pass through ?
>>>
>>>Yes.
>
>
>Not only about that. Just read that FAQ#7995 completely. There is mentioning of using RVs for that. RVs are MUCH more simple. The approach for SPT described there is for programmers that have only option to use SPT and not RV. There is also an explanation of how to do this using ADO (save by AppendChunk and read by ADO stream object).
>
>So, again, Cetin, if you *feel* or *know* it is obsolete - just add comments to it. Everybody will be grateful.
>
>>>
>>>< snip >
>>
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform