ADODB Create New Database from Excel

G

Guest

Is it possible to create a new database from Excel using SQL and ADODB? I
cannot create a connection to a file that is not there.
 
B

Bob Phillips

'----------------------------------------------------------------
Sub CreateAccessDatabase(DBPath As String)
'----------------------------------------------------------------
Dim oADOCat As Object

Set oADOCat = CreateObject("ADOX.Catalog")

oADOCat.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & DBPath

Set oADOCat = Nothing
End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top