Podemos crear bases de datos de Access en tiempo de ejecución con cualquiera de estos códigos ejemplo:
Access 97
Dim wrkPredeterminado As Workspace
Dim dbsNueva As Database
Set wrkPredeterminado = DBEngine.Workspaces(0)
Set dbsNueva = wrkPredeterminado.CreateDatabase(«Mailings.mdb», dbLangSpanish, dbVersion30)
dbsNueva.Close
Access 2007
Dim catDB As Object
Dim cnDB As ADODB.Connection
Set catDB = CreateObject(«ADOX.Catalog»)
With catDB
.Create «Provider=Microsoft.ACE.OLEDB.12.0;» _
& «Data Source=» & App.Path & «\Mailings.accdb»
Set cnDB = .ActiveConnection
End With
Set catDB = Nothing
With cnDB
.Execute «CREATE TABLE Mailings(» _
& «Id IDENTITY CONSTRAINT PK_UID PRIMARY KEY,» _
& «Nom TEXT(60) WITH COMPRESSION NOT NULL,» _
& «Mail TEXT(60) WITH COMPRESSION NOT NULL)»
.Close
End With