Groups | Blog | Home
all groups > dotnet ado.net > april 2007 >

dotnet ado.net : ADOX in VISTA not available??


ChaoTix
4/27/2007 12:00:00 AM
Hi All,

I am using VB.NET 2005 on Microsoft Vista.=20

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:
=20
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=20
'is specified, the database will be created in your
'application folder.
Dim sCreateString As String
sCreateString =3D _
"Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D" & _
DatabaseFullPath
cat.Create(sCreateString)
bAns =3D True
Catch Excep As System.Runtime.InteropServices.COMException
bAns =3D False
MsgBox(Excep.Message, MsgBoxStyle.Critical) <--- =
Throws exception "Class not registered"
'do whatever else you need to do here, log,=20
'msgbox etc.
Finally
cat =3D 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,

Tom Garth
4/27/2007 7:46:01 AM
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.

--
Tom Garth


[quoted text, click to view]
Paul Clement
4/27/2007 8:01:07 AM
[quoted text, click to view]

¤ 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
~~~~
Tom Garth
4/27/2007 12:46:01 PM
Chao,

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


[quoted text, click to view]
ChaoTix
4/27/2007 6:58:34 PM
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" <WinTix@hotmail.com> schreef in bericht =
news:2564F429-5101-4973-9E86-47FA9DEFB787@microsoft.com...
Hi All,

I am using VB.NET 2005 on Microsoft Vista.=20

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:
=20
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=20
'is specified, the database will be created in your
'application folder.
Dim sCreateString As String
sCreateString =3D _
"Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D" & _
DatabaseFullPath
cat.Create(sCreateString)
bAns =3D True
Catch Excep As System.Runtime.InteropServices.COMException
bAns =3D False
MsgBox(Excep.Message, MsgBoxStyle.Critical) <--- =
Throws exception "Class not registered"
'do whatever else you need to do here, log,=20
'msgbox etc.
Finally
cat =3D 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,

Paul Clement
4/30/2007 9:58:36 AM
[quoted text, click to view]

¤ 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
~~~~
AddThis Social Bookmark Button