Hello Peter,
>I was wondering if there is a command or some code that I can use to add fields into an existing table.By the title of your message, I see that you are using FoxPro 2.x, either DOS or Windows. Here are two ways you can do this:
MODIFY STRUCTURE is the command that you can enter in the command window to call up the dialog that allows you to make changes to the structure of a table/dbf.
If you need to do it with code or within a program, that is a bit more complicated, and starts with the command COPY STRUCTURE EXTENDED. That command generates another dbf/table that can have records added/changed/deleted. Then the command CREATE .... FROM is used to create a new DBF file that you can USE and APPEND data into from the existing table.
HTH,
Randy Bosma
VFP - Because life is too short to code in something else...