TransferDatabase of FoxPro file produces error (Access XP)


T

Tomasz Nogalski

In an Access 97 application I used the following command to
import a FoxPro file named "bdeupd.dbf":

DoCmd.TransferDatabase acImport, "FoxPro 3.0", "c:\temp\",
acTable, "bdeupd.dbf", "tblImport"

"tblImport" is a table that already exists in the Access 97
database.

Now I had to update the application to Access XP which has
no direct support for FoxPro files anymore. When I use the
command above I get an error '2507' which tells me that
'the format "FoxPro 3.0" is not an installed database
format or does not support the selected action' (I cannot
print the exact error message here because it is a german
Access XP). I found out that I have to use ODBC instead. So
I created a system DSN named "BDE", using the "Microsoft
FoxPro VFP Driver (*.dbf)" (version 6.01.8630.01).

Then I tried to import the FoxPro database file using
TransferDatabase with ODBC, but without success:

DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=BDE;
UID=;PWD=;SourceDB=c:\Temp;SourceType=DBF;"

produces a 'run-time error 3011'.

DoCmd.TransferDatabase acImport, "ODBC", "DSN=BDE;
SourceDB=c:\temp\", , , "tblImport"

produces a 'run-time error 3170: Could not find installable
ISAM'.

DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=BDE;
SourceDB=c:\temp\", , , "tblImport"

produces a 'run-time error 3011: The Microsoft Jet database
module could not find the object "tblImport1"' (note the
'1' at the end of "tblImport1"; the table "tblImport"
(without a '1') already exists).

Can anyone help me with the correct ODBC string?

Tomasz
 
Ad

Advertisements

C

Cindy Winegarden

In [email protected],
Tomasz Nogalski said:
In an Access 97 application ...
Now I had to update the application to Access XP which has
no direct support for FoxPro files anymore. ...
produces a 'run-time error 3170: Could not find installable
ISAM'.

The following article may help:
http://support.microsoft.com/?id=283881
"Could Not Find Installable ISAM" Error Message

You may need to download and install one of the earlier versions of MDAC -
perhaps v2.5. See
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28001860
for details.
 
J

Joe Fallon

Case "Foxpro"
DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=" &
strDSN, acTable, strTableName, strTableName
 
T

Tomasz Nogalski

When I fill in the variables suitable to my application,
the command looks like the following:

DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;
DSN=BDE", acTable, "tblImport", "tblImport"

where "tblImport" is the name of a table in the Access
database.

However, I still get a 'run-time error 2507: the format
ODBC Database is not an installed database format or does
not support the selected action'.

Regards
Tomasz
 
W

Will

I hope you don't give up this fight. I'm in the same
situation as you. I tried the solutions Joe and Cindy
suggested. Joe's solution produced 'could not find the
object' "tblImport" or "tblImport1" depending on the
extensions I used. I already tried Cindy's suggestion
about installing earlier versions.
 
Ad

Advertisements

T

Tomasz Nogalski

Some trial-and-error revealed the following solution:

DoCmd.TransferDatabase acExport, "ODBC", "ODBC;
DSN=ImportExport", acTable, pstrTable, pstrExportFile

The following prerequisites are necessary:

* A (System-)DSN with data source name "ImportExport",
Microsoft Visual FoxPro Driver, database type "Folder with
free tables" (a german-to-english translation of mine),
field "Path" may not be empty (although it does not matter
which path you fill in there).
* The table "pstrTable" must exist in the Access database.
* The export file "pstrExportFile" has to be specified with
path and extension. It does not matter if the export file
exists or not - it will be created new with each export.

Example:
DoCmd.TransferDatabase acExport, "ODBC", "ODBC;
DSN=ImportExport;", acTable, "tblImport", "C:\Temp\export.
dbf"

Two problems are appearing:

* The export file can not be accessed during the run-time
of MS Access XP. For example, you get an error when you try
to delete the file in the windows explorer. You have to
close MS Access XP to further work with the file (it is not
sufficient to close the MS Access file).
This problem did not exist in MS Access 97.
* In MS Access 97, the command "DoCmd.TransferDatabase
acExport, "FoxPro 2.0", pstrPath, acTable, pstrTable,
pstrExportFile" created (besides the DBF file) another two
files with the extensions ".cdx" and ".inf". These files
may be needed by other programs to work with the FoxPro
file.


The import of data from a FoxPro database (.DBF) into an MS
Access XP database works using the following command:

DoCmd.TransferDatabase acImport, "ODBC",
"ODBC;DSN=ImportExport;SourceDB=C:\Temp\;SourceType=DBF;",
acTable, pstrImportFile, pstrTable

The following prerequisites are necessary:

* A DSN (see above).
* The table "pstrTable" should not exist before in the
Access database (otherwise a consecutive number will be
added to the table name).
* The import file "pstrImportFile" has to be specified
without path and without extension. Instead, the path is
specified in "SourceDB=" and the extension is specified in
"SourceType=". Otherwise a run-time error 3011 is produced.

Example:
DoCmd.TransferDatabase acImport, "ODBC",
"ODBC;DSN=ImportExport;SourceDB=c:\Temp\;SourceType=DBF",
acTable, "import", "tblImport"

One problem is appearing:

* The import file can not be accessed during the run-time
of MS Access XP (see above, analog to export file). In my
case this is precarius as the imported files should be
renamed after the import. This problem did not exist in MS
Access 97.

If anyone has a solution for the problems I mentioned, I
would be happy to know them ;-)

Regards
Carsten
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top