What type of database? MS Access, SQL Server, other?
Some ways are below:
==== MS Access ====
Create a standard blank MS Access MDB file, named "DEFAULT.MDB"
When ready to create a new database, copy the "DEFAULT.MDB" file to the filename that the user provided, then use this database accordingly.
==== SQL Server ====
Whatever application/script you're using needs to have permissions to create databases on the server. Then simply call the CREATE DATABASE commands with your user-provided name, and any options you want, and use this database accordingly.
SET oCat = CreateObject("ADOX.Catalog"
oCat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ADOX.mdb"
oCat.ActiveConnection.Close
SET oCat = Nothing
or automate Access if it's installed,
SET oAccess = CreateObject("Access.Application"
oAccess.NewCurrentDatabase "C:\Access.mdb"
oAccess.CloseCurrentDatabase
oAccess.Quit
SET oAccess = Nothing Jon Hawkins
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.