Sébastien
1/16/2003 11:21:00 AM
Hi,
I try to open a connection with Ms access using a DNS in the connection
string.
here is my webmethod:
<WebMethod(Description:="Open an ODBC connection with DSN")>
Public Function RetrieveCustomers() As String
Dim MyConnection As OdbcConnection
Dim MyAdapter As OdbcDataAdapter
Dim MyDataset As DataSet
Dim connectionstr As String
sqlstr = "SELECT * FROM T_Customer;"
connectionstr = "dsn=dbtest"
MyConnection = New OdbcConnection(connectionstr)
MyConnection.Open()
System.Windows.Forms.MessageBox.Show("ServerVersion: " +
MyConnection.ServerVersion _
+ ControlChars.Cr + "DataSource: " + MyConnection.DataSource.ToString())
MyConnection.Close()
End Function
When I debug my application, an error occurs while opening the connection
and says:
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> Microsoft.Data.Odbc.OdbcException: ERROR [IM002]
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified at Microsoft.Data.Odbc.OdbcConnection.Open()
I suppose that the ODBC data source is well configured.
Any ideas??
thanks
Sébastien