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:
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.
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.