Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server field type to store .pdf file
Message
De
06/07/2004 12:03:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00918564
Message ID:
00921057
Vues:
41
Sergey,
I haven't used this approach for large files. Just did some quick testing and it seems that the limit is about 8MB. After that the function StrToHex() returns a "String too long" error.

For larger files, Vlad's workaround seems to work fine.

>Daniel,
>
>What is the max size of PDF or any other file that can be inserted this way?
>BTW, In VFP8 and later STRCONV(, 15) can be used to convert string to hexa-decimal.
>
>>
>>There is another way to upload binary data from VFP to a SQL Server image field. You have to send the binary data as HEX. The code below should give you an idea. Unfortunately, I don't know of any other way to retrieve binary data from SQL Server other than the hack with the General/Memo field described in Vlad's article.
>>
>>
>>*-- convert PDF to HEX
>>lcHex = StrToHex(FILETOSTR("c:\temp\SomeFile.pdf"))
>>*-- add to SQL Server
>>SQLEXEC(lnSql, "INSERT INTO YourTable (ImageField) VALUES(" + lcHex + ")")
>>
><snip>
Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform