Sql-server – Importing a Foxpro Database

foxproimportodbcsql server

I have a Fox Pro database (one DBC and a bunch of DBF files) that I want to import into SQL via the Import and Export wizard.

I downloaded the FoxPro ODBC driver. I managed to get to the screen that shows all table name. I can even preview the data, except if I try to go next I will get

Column information for the source and the destination data could not be retrieved, or the data types of source columns were not mapped correctly to those available on the destination provider.

"somecolumn" -> [dbo].[somecolumn]:

  • Cannot load the column attributes from the schema using the current provider descriptor:

The column attribute "ORDINAL_POSITION" is not valid.

Please verify the ProviderDescriptors.xml file contains the data provider descriptor that matches the schema of the used data provider.

I understand I need to fix the ProviderDescriptors.xml file, which has this line

OrdinalPositionColumnName="ORDINAL_POSITION"

But what can I put in there? I have guessed the following

  • POSITION
  • ORDINALPOSITION
  • ID
  • INDEX
  • OFFSET

All of the above doesn't work.

Best Answer

In FoxPro, under the Wizard menu, choose "upsizing". From there, choose an ODBC connection to the SQL Server database and step through it. Also, there is a much improved upsizing Visual FoxPro project that you can download here.

I have had trouble upsizing to SQL Server 2008 and above so if you have a SQL Server 2005 database around, you might have more success upsizing to it and migrating your tables to there final destination.