Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing a DBase IV file using TransferDatabase 1

Status
Not open for further replies.

mikevh

Programmer
Apr 23, 2001
1,033
US
I'm trying to import a DBase IV file using
DoCmd.TransferDatabase, and am having no luck. After
looking at the help, I'm confused about the arguments.
Here's what I've got:

DoCmd.TransferDatabase _
TransferType:=acImport, _
DatabaseType:="DBase IV", _
DataBaseName:=Me.txtImportFileName.Value, _
objectType:=acTable, _
Source:=Me.txtImportFileName.Value, _
Destination:=Me.cboInputTable

txtImportFileName.Value is the name of the DBase file,
including path.

cboInputTable is the name of the table that I want to
import the DBase file to.

I don't think I understand what "DataBaseName" is supposed
to be. Is it the name of the database I'm importing
into? I tried using

CurrentProject.Path & "\" & CurrentProject.Name

in that position, but then I get a message telling me that's
not a valid path. (In what I show above, DatabaseName is
the same as Source, which I don't think can be right.)

Any help much appreciated. Thanks.
 
When importing Dbase files, the Database Name argument should be the Directory containing the File.
The Source argument should be the name of the dbase file including the .dbf extension. To see a better explanation of the aruguments, look up the Transfer Database ACTION
It does a much better job explaining dbase imports than the Transfer Database Method.

HTH

Paul
 
Thanks, I got it.
Your're right, the explanation of the TransferDatabase Action is much clearer.
 
What would I have to type in the following code:
DatabaseType:="DBase IV" if I want to instead import
Foxpro 2.6 data?

Steve
 
I don't see FoxPro on the list of Db you can import. You might post your question in the VFP forum. forum182
They may be able to help you.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top