Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 467671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:36:19+00:00 2026-05-12T23:36:19+00:00

We have an application that creates a number of Visual Foxpro (DBF) tables. Each

  • 0

We have an application that creates a number of Visual Foxpro (DBF) tables. Each of those tables have a different schema, but they all contain a known date field.

I’ve been asked to create another application (in C#) that will copy the last week’s worth of data from each table to a new table (in a different folder to the source tables). The distinct tables will remain (e.g. if there are three source tables, there will be three destination tables).

Over time the tables may change (e.g. new fields added), so I can’t make assumptions about table structure (apart from the existence of the aforementioned date field).

What’s the easiest/best way to take the data from one table and create a new table with the same structure?

I know how to query the tables to extract the data (e.g. fill a DataSet with the last week’s records). However, I’m thinking there must be a better way of creating a new table and filling it with the results than manually parsing all the field information in the schema and using that to recreate the the destination table.

Working with FoxPro seems to be different enough from SQL Server to give me a headache at each turn, so I need some guidance on my approach.

The production machine has the VFP 9 OLEDB driver installed on it. If possible, we’d prefer not to have to install much else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:36:19+00:00Added an answer on May 12, 2026 at 11:36 pm

    To get an exact copy of the data, table, and records, you can do via a single SQL-Select via

    OleDbConnection oConn = new OleDbConnection("Provider=VFPOLEDB.1;Data Source=C:\\SomePath");
    OleDbCommand oCmd = new OleDbCommand();
    oCmd.Connection = oConn;
    oCmd.Connection.Open();
    oCmd.CommandText = "select * from SomeTable where someCondition into table YourNewTable";
    oCmd.ExecuteNonQuery();         
    oConn.Close();
    

    Your where clause could be almost anything, and the Into TABLE clause tells the VFP engine to create the result set AS A NEW TABLE, so no need to explicitly declare types, columns, etc, query data from one and push into another…

    One issue of consideration… Verify the user access to obviously be able to create, read, write wherever you are trying to create the new table. You can even specify a fully qualified path, such as C:\SomeOtherPath\Monthly\MyTable1 if need be…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application creates coupons that each need a unique barcode number. This number needs
I have an application that has created a number of custom event log sources
I have an application that creates, and destroys thousands of objects. Is it worth
I want to run javascript/Python/Ruby inside my application. I have an application that creates
I have an information retrieval application that creates bit arrays on the order of
I have an application that gets installed with a Wise installer (EDIT: Wise creates
We have an internal .NET case management application that automatically creates a new case
I have a Visual Studio 2008 Windows Mobile 6 C++ application that is using
I currently have a small console application that runs a number of Tasks (using
I have a monitoring application in python 2.6 that calculates the number of entries

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.