Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving FileStream from SQL Server
Message
De
12/07/2011 12:53:52
 
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 SP2
Database:
MS SQL Server
Divers
Thread ID:
01517970
Message ID:
01517977
Vues:
43
Superb Dan!

>Frank,
>
>It's been a little while but here is the statement that I've used in VFP to store a JPG file using FileStream -
>
>
lnRet = SQLEXEC(lnHandle, "UPDATE [alumnus] SET [ClassPhoto] = (SELECT BulkColumn FROM OPENROWSET(Bulk 'c:\temp\jpgs\MyFileName.jpg', SINGLE_BLOB) AS BLOB) WHERE AlumnusPK = 'MyPK'")
>
>HTH
>
>-Dan
>
>>Hi,
>>
>>I am using FileStream in my SQL Server 2008 R2 database to store a PDF. I use this code:
>>
>>
UPDATE Claims
>>	SET clm_Scan = CONVERT(VarBinary(max), N'MyFileName.pdf')
>>	WHERE clm_PK = 'MyPK'
>>
>>I want to let the user now view the PDF, so I query the clm_scan field then use STRTOFILE() to create the file oon my disk, but when I try to open the PDF I get a message that "Adobe Reader could not open the file because it is either not a supported file type or because the file has been damaged..."
>>
>>Am I doing this right?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform