CREATEDB Jet and SQL

joe_pool_is

Well-known member
Joined
Jan 18, 2004
Messages
451
Location
Texas
Create Access Db

Try something like this;

Private Sub CreateDatabase(ByVal DBName As String)
Dim Cat As Catalog = New Catalog
Try
Cat.Create("Provider=Microsoft.Jet.OLEDb.4.0;" & _
"Data Source=" & _
DBName & ";" & _
"Jet OLEDb:Engine Type=5")
Access Database Versions;
Type 5 - Access 2000
Catch ex As OleDbException
MessageBox.Show(ex.Message, _
"OLEDb Error", _
MessageBoxButtons.OK, _
MessageBoxIcon.Exclamation)
Catch ex As Exception
MessageBox.Show(ex.Message, _
"VB.Net Error", _
MessageBoxButtons.OK, _
MessageBoxIcon.Exclamation)
Finally
Cat = Nothing
End Try
End Sub
 
Thanks macdonab, that turns out to be exactly what I used.

Still, it seems strange that Microsoft would point out the command CREATEDB and tell what it does without actually having a way to use it.
 
Back
Top