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

Create Database

Status
Not open for further replies.

charlie12345

Technical User
Mar 4, 2001
28
US
I need to create a new database in order to export a table.
Exporting the table is no problem, but I can't seem to create a new database.
I get 'Invalid Argument' with:
Set dbsNew = DBEngine.Workspaces(0).CreateDatabase("NewDB.mdb", dbLangGeneral)

It must be obvious, but I can't see it.

Charlie
 
This is what works for me, try breaking it down like so...

Sub newdb()
Dim wrk As Workspace
Dim db As Database

Set wrk = DBEngine.Workspaces(0)
Set db = wrk.CreateDatabase("c:\mynewdb.mdb", dbLangGeneral)

End Sub

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top