T
Tim
Hi folks,
I have the following code to create a new database called test.mdb and
transfer a table, table1, to the database. Some time, it works fine but some
time it gives me the error message “Run – Time error ‘3049’. Cannot open
databaseâ€
Could anyone know the problem and the solution for it?
Any help will be appreciated
Thanks in advance.
Tim.
Public Sub Export()
Dim appAccess As Access.Application
Dim strFileName As String
strFileName = "c:\temp\test.mdb"
Set appAccess = CreateObject("Access.Application.10")
appAccess.NewCurrentDatabase strFileName
Set appAccess = Nothing
DoCmd.TransferDatabase acExport, "Microsoft Access", strFileName, _
acTable, "Query1", "table1", False
End Sub
I have the following code to create a new database called test.mdb and
transfer a table, table1, to the database. Some time, it works fine but some
time it gives me the error message “Run – Time error ‘3049’. Cannot open
databaseâ€
Could anyone know the problem and the solution for it?
Any help will be appreciated
Thanks in advance.
Tim.
Public Sub Export()
Dim appAccess As Access.Application
Dim strFileName As String
strFileName = "c:\temp\test.mdb"
Set appAccess = CreateObject("Access.Application.10")
appAccess.NewCurrentDatabase strFileName
Set appAccess = Nothing
DoCmd.TransferDatabase acExport, "Microsoft Access", strFileName, _
acTable, "Query1", "table1", False
End Sub