Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert BLOB from Gen field?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00416010
Message ID:
00416304
Vues:
23
I'm no SQL Server expert, so I don't know the best way to do it. I can tell you an approach that I was introduced to recently which made my jaw hang slack....

Using FileToStr(), pull the entire DOC file into a character memory variable. STORE that memory variable to a memo. When you need to reconstitute the file, use StrToFile(). This will avoid the issue of GENERAL fields all together.

I was very skeptical of this approach when I first saw it. I was certain that Fox would choke on the high end ASCII values it would see when sucking in a binary. I built a small test and pulled in a folder full of files (all types, exe's, docs, dbf, etc), deleted them all, then reconstituted them. It worked without a hitch. I keep thinking of cool ways to use this trick. The demonstration that I was given was using a table to store a FileToStr() DBC in. The table knew what the checksum was of the DBC. It compared SYS(2007, FileToStr("foo.dbc") to Table.DBCChecksum. If they were different, it dumped the StrToFile of the DBC from a memo field in the table. Completely avoided the whole GenDBC issue.

Sounds nuts, but I couldn't make it blow up. Stunning.

Marty
Marty Smith, CSQE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform