W
Wayne Wengert
I am trying to create an Access 2000 database using VB.NET. I found the code
below via a google search but when I run it I always get an error.
I do have a reference to Microsoft ADO Ext. 2.7 for DDL and Security. The
path and file name are valid. Any thoughts on how to debug this?
If I use the Command window to try to find out what the error is I get
messages like this
?Excep.ErrorCode
'Excep.ErrorCode' is not declared or the module containing it is not loaded
in the debugging session.
==================== Code ====================
Public Function CreateAccessDatabase(ByVal DatabaseFullPath As String) As
Boolean
Dim bAns As Boolean
Dim cat As New ADOX.Catalog
Try
Dim sCreateString As String
sCreateString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
DatabaseFullPath
cat.Create(sCreateString)
bAns = True
Catch Excep As System.Runtime.InteropServices.COMException
bAns = False
Finally
cat = Nothing
End Try
Return bAns
End Function
below via a google search but when I run it I always get an error.
I do have a reference to Microsoft ADO Ext. 2.7 for DDL and Security. The
path and file name are valid. Any thoughts on how to debug this?
If I use the Command window to try to find out what the error is I get
messages like this
?Excep.ErrorCode
'Excep.ErrorCode' is not declared or the module containing it is not loaded
in the debugging session.
==================== Code ====================
Public Function CreateAccessDatabase(ByVal DatabaseFullPath As String) As
Boolean
Dim bAns As Boolean
Dim cat As New ADOX.Catalog
Try
Dim sCreateString As String
sCreateString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
DatabaseFullPath
cat.Create(sCreateString)
bAns = True
Catch Excep As System.Runtime.InteropServices.COMException
bAns = False
Finally
cat = Nothing
End Try
Return bAns
End Function