We have an application that creates several Visual Foxpro tables (DBF). Each of these tables has a different schema, but they all contain a known date field.
I was asked to create another application (in C #) that will copy the data for the last week from each table to a new table (in a different folder in the source tables). Separate tables will remain (for example, if there are three source tables, there will be three destination tables).
Tables can change over time (for example, new fields are added), so I canβt make assumptions about the structure of the table (except for the presence of the specified date field).
What is the easiest / best way to take data from one table and create a new table with the same structure?
I know how to query tables to retrieve data (for example, populate a DataSet with records from last week). However, I think there should be a better way to create a new table and populate it with results than to manually parse all the field information in the schema and use it to recreate the destination table.
Working with FoxPro seems to be quite different from SQL Server to give me a headache at every turn, so I need to be guided by my approach.
The production machine has the VFP 9 OLEDB driver installed. If possible, we would prefer not to install much more.
source
share