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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Docmd.Transferdatabase Can't Find File 1

Status
Not open for further replies.

plist

Technical User
Oct 19, 2004
4
US
I have code from an old Access 97 database that does not
work in Access 2000. I keep getting a Run-time err04 '2043' and the database can't find the newly created file. The DoCmd.Transferdatabase method does not seem to work.

I am using the statements:

Set newDb = DBEngine.Workspaces(0).CreateDatabase(strvarPartsListFileName, dbLangGeneral)

and

DoCmd.TransferDatabase acExport, "Microsoft Access", strvarPartsListFileName, acTable, "Table1Export", "Table1"

Any help will be appreciated.
 
Have you checked that the Microsoft DAO 3.# library is referenced ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for your reply. The Microsoft DAO 3.6 Object Library is referenced, but the problem still exists.
 
if you are using
Dim newDB as Database
try
Dim newDB As DAO.Database

PaulF
 
Thanks. I tried:

Rem Dim newDb As Object and
Rem Dim newDB As Database and
Rem Dim newDB As DAO.database.

They all did not work.

Very respectfully,

plist
 
Could it be that the database is created, but the process isn't finished when you run the transferdatabase? What happens if you step thru the code, does it work then?

Another thing, does your path/name string also include the extension (c:\mydb.mdb)? This should bring the 3024 error, though.

Roy-Vidar
 
Roy Vidar:

Putting the mdb extension in the path name solved the problem. Thanks. Stepping throught the code did not help. The database was being created, but the program would not find it if the ".mdb" was not entered in the text box. Thank you again for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top