is it possible to create another dataase through using VBA?

Matrix_zero

Registered User.
Local time
Today, 15:11
Joined
Jan 26, 2005
Messages
64
is there a way to create a database using vb saying something like this

create a new database called "DataFile"
and copy table1, table2, table3, and table4 from the current database file to the database called "DataFile"

part of my splashscreen checks for the database, if it isn't in the same directory as the file... possibley the first time it is opened, i would like to setup a new db file with these tables.

Is this even possible?
 
Thanks

Wow, thanks MStef!

That was exactally what i needed!


Is there a way to modify that code to make the newley created database have a password?
 
Last edited:
Nevermindd

nevermind, i found it... incase anyone else wanted to know, here it is using a DAO 3.6 Reference

Dim Db As Database
Set Db = OpenDatabase(CurrentProject.Path & "Data.MDB", True, False)
Db.NewPassword "", "12345"
Db.Close
 

Users who are viewing this thread

Back
Top Bottom