Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Store documents in a database
Message
 
 
À
15/11/2004 07:06:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00960032
Message ID:
00963333
Vues:
9
Marc,

Sorry it took a while to get back to this. It works fine for DBFs too:
public gnSQLConnection
gnSQLConnection = 0

gnSQLConnection = SQLSTRINGCONNECT( "driver={SQL Server};server=(local);database=test;trusted_connection=yes;" )

create table testsqlstore free ( i1 i, c1 c(10) )
for i = 1 to 1000
   insert into testsqlstore values ( i, str(i) )
endfor
use

lcFile = filetostr( "testsqlstore.dbf" )

? sqlexec( gnSQLConnection, "insert into SQLFileStore values ( 'testsqlstore.dbf', ?lcFile )" )

? sqlexec( gnSQLConnection, "select * from SQLFileStore", "sptcursor" )
? sptcursor.tFileContent == lcFile

? strtofile( sptCursor.tFileContent, "c:\temp\outputtestsqlstore.dbf" )

use c:\temp\outputtestsqlstore.dbf
browse last
Is it possible that you tried to push a table from a DBC up and did not have the DBC available when you wrote the table back out to disk? Did the table have any index tags? If so you'll need to push/pull the CDX to SQL.

>Thanks for your help. I try your solution, it works well but if I want to store a DBF file and restore it with STRTOFILE I can't open it. VFP said that it's not a table.
>
>Are you sure that your solution is valid for all file's extensions ?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform