ADOX in VISTA not available??

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
 
P

Paul Clement

¤ 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??

ADOX is part of MDAC so it should definitely be there. Which line of code is generating the error?
cat.Create?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
G

Guest

Paul,

The 'Class not registered.' error doesn't seem to say this, but I was
wondering if you have User Account Control turned on. It may be that you
can't' write to the location requested by the DatabaseFullPath argument.
 
C

ChaoTix

The exception is thrown to the line says: "cat.Create(sCreateString)"

I am using the direct Administrator of the computer (not just another user whith admin right).

I am also using a interop.adox.dll, which should be also compatable with vista.

Greetz,

Patrick.
"ChaoTix" <[email protected]> schreef in bericht 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
 
G

Guest

Chao,

Even as Administrator you might have to either turn off 'User Account
Control' or Use "Run as Administrator" to start Visual Studio 2005.
 
P

Paul Clement

¤ The exception is thrown to the line says: "cat.Create(sCreateString)"
¤
¤ I am using the direct Administrator of the computer (not just another user whith admin right).
¤
¤ I am also using a interop.adox.dll, which should be also compatable with vista.

Try removing the reference to ADOX from your project and deleting the interop file from your bin
folder. Then re-add the reference to ADOX and run your project.


Paul
~~~~
Microsoft MVP (Visual Basic)
 

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