Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FoxPro to DTS error - file not in expected format

Posted on 2004-09-23
4
Medium Priority
?
873 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
ID: 12138335
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
ID: 12138503
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 150 total points
ID: 12143531
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
ID: 12148008
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

916 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