Promote Your Blog
Google

Saturday, January 28, 2012

How To Create An MS-Access Database Using ADOX and Visual Basic

Dim acat As New ADOX.Catalog()
Try

Dim sCreateString As String
sCreateString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"MyLibrary.mdb" 'you can give path also otherwise db will created in app folder
acat.Create(sCreateString)

Catch Excep As System.Runtime.InteropServices.COMException
MsgBox("DB Cannot be created")
Finally
cat = Nothing 'clean up is very important
End Try

No comments:

Post a Comment