C
ChaoTix
Hi All,
I am using VB.NET 2005 on Microsoft Vista.
I have opened a project in VB.NET and when i try to run it, it will cause a error on the adox.
Here is my Source:
Public Function CreateAccessDatabase(ByVal DatabaseFullPath As String) As Boolean
Dim bAns As Boolean
Dim cat As New ADOX.Catalog
Try
'Make sure the folder
'provided in the path exists. If file name w/o path
'is specified, the database will be created in your
'application folder.
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
MsgBox(Excep.Message, MsgBoxStyle.Critical) <--- Throws exception "Class not registered"
'do whatever else you need to do here, log,
'msgbox etc.
Finally
cat = Nothing
End Try
Return bAns
End Function
It worked perfectly fine in Windows XP/2000. Even on servers 2003.
The error is "Class not registered". Does ADOX not work anymore in Vista??
Kind regards,
ChaoTix
I am using VB.NET 2005 on Microsoft Vista.
I have opened a project in VB.NET and when i try to run it, it will cause a error on the adox.
Here is my Source:
Public Function CreateAccessDatabase(ByVal DatabaseFullPath As String) As Boolean
Dim bAns As Boolean
Dim cat As New ADOX.Catalog
Try
'Make sure the folder
'provided in the path exists. If file name w/o path
'is specified, the database will be created in your
'application folder.
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
MsgBox(Excep.Message, MsgBoxStyle.Critical) <--- Throws exception "Class not registered"
'do whatever else you need to do here, log,
'msgbox etc.
Finally
cat = Nothing
End Try
Return bAns
End Function
It worked perfectly fine in Windows XP/2000. Even on servers 2003.
The error is "Class not registered". Does ADOX not work anymore in Vista??
Kind regards,
ChaoTix