ADO.NET problem with provider

shootsnlad

Well-known member
Joined
Feb 14, 2002
Messages
46
I have a program I am trying to get connected directly to a Informix database via ODBC, instead of having to go through Access and then to the database. I first tried using the wizard in Standard VB.NET, but I always got an error message about not being able to do what I wanted in this version of Visual Studio. Something about only being able to conect to SQL Server Desktop Engine databases and Access Databases. I then decided to use ADO.NET. I am having a problem with the connection string. I think it has something to do with the provider. Here is the error message I get:

An unhandled exception of type System.ArgumentException occurred in system.data.dll

Additional information: The .Net Data OLE DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers.

Here is my code:

[VB]

Dim dagisconstring As String
Dim textline As String
dagisconstring = "Provider=Microsoft OLE DB Provider for ODBC Drivers;DSN=dagisNT;DB=dagis;HOST=198.212.171.17;SERV=turbo;SRVR=DBQ_Informix;PRO=onsoctcp;UID=informix;PWD=informix"
Dim dagisdbcon As New System.Data.OleDb.OleDbConnection(dagisconstring)
dagisdbcon.Open()
Dim emptycityda As New System.Data.OleDb.OleDbDataAdapter("Select * from dub.city_parcels", dagisconstring)
Dim emptycityds As New DataSet()
emptycityda.Fill(emptycityds, "dub.city_parcels")
Dim emptycitydt As DataTable = emptycityds.Tables("dub.city_parcels")

[/VB]

Thank you for the help. For now Ill have to stick with the Access link.
 
Just curious (since I havent yet had the joy of working with
ADO.Net) since the error message includes...
The .Net Data OLE DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers.
Does ADO.Net support ODBC drivers at all? If not, then how can
he even make this connection?
 
Ive just started connecting to the Oracle database at work with .Net, and the only way Ive been able to get connected is with ODBC or OLEDB. (We have an older installation of Oracle 6.3.7 - the upgrade to 8i is to take place in a couple of months, and the oracle .Net provider requires 8.i or greater on the client.)

As with VB, you need to make sure that the project refereces ADODB if you follow this approach..

Project
Add Reference

then select adodb.
 
Heres a few ideas, not sure if any will help.

1. Try changing the Provider from "Microsoft OLE DB Provider for ODBC Drivers" to "MSDASQL"
2. The IP has a space between 171 and 17. Might cause future problems (but probably not the one youre seeing).

I cut-n-paste your error string in google and it showed a few other people having similar problems. The articles I scanned related to a beta version of .NET but they may have some workarounds to help...

-ner
 
Back
Top