Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing DBF File Structures on the Fly
Message
De
10/11/1998 12:45:53
 
 
À
10/11/1998 11:20:48
Vernon Moeller
Texas Adjutant General's Department
Austin, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00156177
Message ID:
00156236
Vues:
25
Vernon,
I like George's suggestion. Here are two others to look into:
1. Use ALTER TABLE ALTER COLUMN ... if the change of structure will effectively change the data.
2. Use SELECT - SQL as in:
select str(somenumbfield,x,y) as somenumbfield, val(somecharfield) as somecharfield,...
into table somenewtable
if you have to manipulate the data to accomodate the new table structure.
I hope this helps.
-Dore

>In addition to working in FPW2.6, I also use a product called Monarch which I feed printouts into, and it extracts data from them and sticks the data into a DBF file.
>
>Unfortunately, Monarch often misinterprets data. It will look at 2 character fields separated by a slash (/) and, since they contain only numbers, create 2 numeric fields. Then it will look at a transaction amount field, clearly numeric because of the dollar sign and decimal point in it, and because the dollar sign is not a number, create a character field.
>
>Then, since I am running Monarch as part of a "batch" file, when I get back into FPW, of course, nothing prints out or calculates correctly.
>
>So my question is this: is there any way I can create code which will automatically open my DBF and change some of its numeric fields to character and vice-versa without losing my data? When Monarch writes the new DBF, it will overwrite a file with the same name even though that file (the old one) has the correct format, so setting up something in advance won't work. Of course, I can do this manually, but with all the reports our people run, I don't want to sit there changing field types all day long.
>
>And this is a real long-shot question, but do any of you know of a product out there that works like Monarch but doesn't have this glitch where it reads character fields as numeric and vice-versa?
>
>Thanks for whatever help you may have to offer!
>
>\/\/\
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform