Solved

FoxPro to DTS error - file not in expected format

Posted on 2004-09-23
4
830 Views
Last Modified: 2013-11-30
I am attempting to use DTS to import some FoxPro tables into SQL 2000. When I use the Visual FoxPro driver and a DSN I do not get all the .dbf tables.

When I try a different way of getting the tables over (i.e. DBase III driver) I see all of the tables, but upon selection of one I get the error "External Table is not in the expected format" and "Context: Error calling openrowset on the provider".

I can open all of the tables in DBF Viewer 2000 no problem.

This has to be an automated process, so I cannot manually go and convert the file(s) every night. I just need to see the missing tables and bring the data over.

To help out I have the following tables accompanying the DBF file:

.cdx
.bkp
.bpt
.db3
.fpt

I just need to run DTS and get the data. All of the other tables are imported and it works fine. Any ideas?
0
Comment
Question by:ocguy
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:tmedley
Comment Utility
You need to be using the latest greatest VFP driver to start with. Then you need to know if you are dealing with .dbf tables that belong to a container (.dbc) or if they are free tables. My guess is that some of the tables are free, some are in one .dbc and others might even be in a second or third .dbc. Check the directory for file sending in .dbc and build a connection for each. You may have to build more than one connection because of this. You also may be able to get away with specifiying that they are all free tables even if they are not. The dbase drivers are not going to open vfp tables that belong to a .dbc even though they will see them. They only needs the .dbf extension to see the files.

Tell me exactly what vfp driver you are using and what options you set on it and I will suggest something new.

Also give me a dir on the file ending in .dbf and .dbc.
dir *.dbf > dbf.txt
dir *.dbc > dbc.txt
then cut and paste the results
then mark the ones that do not show when you are using your DSN


0
 

Author Comment

by:ocguy
Comment Utility
I am using the latest version of the Visual FoxPro driver - downloaded it the other day from Microsoft. VFPODBC.dll

I set up a DSN through this driver - it points to the folder. Here are are the files:

DTS transforms and writes the following tables

ardetail.dbf (also in folder is ardetail.cdx)
armaster.dbf (also in folder are armaster.cdx, armaster.fpt)
inmaster.dbf (also in folder are inmaster.cdx, inmaster.fpt)
pldetail.dbf (also in folder is pldetail.cdx)
plmaster.dbf (also in folder is plmaster.fpt)
pomaster.dbf (also in folder are pomaster.cdx, pomaster.fpt)
tamaster.dbf (also in folder is tamaster.fpt)


Do Not See in DTS wizard

apmaster.dbf
(its accompanying files)
apmaster.cdx
apmaster.bkp
apmaster.bpt
apmaster.db3

I need apmaster but the name doesn't even show up when I get to the part in the DTS wizrd where you can preview data in a table. I tried the dBase driver and can see all tables (and have tried free table dir and the other option - no difference) but when I go to preview I get the "External Table is not in the expected format" and "Context: Error calling openrowset on the provider". Probably the wrong way to do it but the apmaster table is simply invisible.

Do you think that the files accompanying apmaster are throwing a glitch into my efforts?

Thanks so much for looking into this.
0
 
LVL 6

Accepted Solution

by:
tmedley earned 50 total points
Comment Utility
I do not think the other files are causing you a problem but they do suggest what the problem might be. The .bkp and .bpt file extensions suggest that the application that orginially created the files was a dbase app not a fox app. These would be backup files for the table and its memo field file indicating that the .dbf should also have a memo field file with an extension .fpt - if that file is not present fox (or the ODBC driver) will not open the dbf. In fox you would get an error saying missing or invalid memo file.

Questions: Is there a working application in fox using the apmaster.dbf table ? Do you have a copy of VFP you can open the table with ? Are the files in their native location or are these copies being put there from some other process that is not copying the .fpt file ?

0
 

Author Comment

by:ocguy
Comment Utility
Some of the extra files were causing an error. I removed them and I am now successfully importing the data. Thanks for your help.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now