Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change General to Memo Fields in dbf Header ?
Message
 
 
À
06/07/2002 14:21:27
Frank Mundo
WindowDressers, Inc.
Maine, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00675688
Message ID:
00675882
Vues:
11
See faq #7995 for sample code that changes field type. You'll have to find offset of your general field description in the table header or you can copy them one by one and use existing code. Why do you want to store them in memo field at all? You can keep them as seprate files on disk and store file's full name (including path) in the table. Make sure that you've backup copy of the table before you start playing with it.

>>>My problem is to convert Sketches stored Embedded in General Fields to Memo fields so that I can subsequently use COPY MEMO TO to create a file for an ActiveX 3rd party sketching program.
>>>
>>>This... because there is no COPY GENERAL TO ... command!
>>>
>>>Must I write a low-level I-O program to copy existing Sketches to files and then APPEND MEMO FROM or is there a way to change the Header of the DBF to make the "General" Field a "Memo" field? Can I get away with this caper.. or is there something that would prohibit me from doing this? Finally, can this be done without rewriting the entire DBF?
>>
>>There's no COPY GENERAL TO command because data stored on general filed with some additional info. If you simply copy data from the general field to the file it wouldn't be recognized by programms that works with such data. That's one of the reason why it's not recomended to store data in general fields.
>
>
>Sergey,
>
>Thanks for responding. My problem is I have large installed base (30+ sites) with DBF's with (400->10,000) Sketches already Embedded in General Fields. Now my 3rd Party is offering an ActiveX capability that requires their sketches be on disk as discrete files.. which I need to place out there for display and update before they're stored back in memo fields, during regular processing.
>
>I understand that "embedded" means there is stuff to be trimmed off each sketch that exists as currently stored in the General Field. I was hoping to change the DBF header so that the field became MEMO... then write a program to read the file, calling an low-level IO routine to write each General field contents to a discrete file (less the now superflous embedded descriptor on the front) then APPEND FROM to the Memo field... as a one time conversion.
>
>I would need to know whether and how to update just the dbf header (if that is possible), and get a reading from whether all that "embedded" means is that there is stuff on the front of file that I can drop. My constraints are disk space, the fact that this going to occur on remote sites, that the table involved is part of a DBC...
>all of which discourage a more simplified approach (using ALTER, adding deleting and renaming columns, etc. But I may need to go this route.
>
>I have written a program to create a modified file from the General Field ... but don't know how to update just the dbf header... whether that is possible or if I'm missing something.
>
>Frank
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform