>I somehow copied the wrong table into the release of my software. doh
>of course it is missing a few fields. My question is if i just copy the new table would it mess up the DBC or should i have a routine to use alter table?
>
>If im using alter table what is the best way to check to see if the fields exist??
>
>Thanks
>
>Paul
Paul,
I am not a "guru" in this area, and this seems *fundamental* enough to warrant expert advice. I hesitate to hand out advice, just my opinions.
If you USE Database.DBC SHARED NOUP and browse, you can see it stores the field definitions there. DBGETPROP() will pull information from here. If you issue a VALIDATE DATABASE, you'll get errors. I doubt if you can even USE the table if the fields are drastically different, less do an ALTER TABLE.
If the app has not run, perhaps I would just copy the DBF over on top of the wrong one. As far as the database definition has not been altered to fit the wrong table fields by some background DB engine process (which I do not know does or does not happen), I think it sounds safe to do just that. However, what if the app has run? There may be records in other tables with references to the affected table.
AFIELDS() can be used to retrieve a list of fields from the table itself if it is open.
Perhaps in my case I would feel safe to redeploy a virgin set of data which is correct.
Kenneth.