I am trying to connect to an IBM AS/400 Database. I have created a system DSN called "SR". I am using the following code:
VB Code:
Dim cnItemConn As New Odbc.OdbcConnection Dim daItemAdapter As New Odbc.OdbcDataAdapter Dim dsItemSet As New DataSet Dim cmdselect As New Odbc.OdbcCommand Dim sCmd As String cnItemConn.ConnectionString = "DSN=SR;uid=xxxx;pwd=yyyyy;Driver={Client Access ODBC Driver (32-bit)}" dsItemSet.Tables.Add("Items") sCmd = "SELECT IASA.ITNBR, IBL.MOHTQ, IASA.WHSLC, IASA.ITDSC FROM AMFLIBX.ITEMBL AS IBL LEFT OUTER JOIN AMFLIBX.ITEMASA AS IASA ON IBL.ITNBR=IASA.ITNBR WHERE IASA.ITNBR ='90503'" cmdselect.Connection = cnItemConn cmdselect.CommandText = sCmd daItemAdapter.SelectCommand = cmdselect daItemAdapter.Fill(dsItemSet.Tables("Items"))
When I run this code in an ASP.NET Web App I get an error, "Data Source Name not found and no default driver specified." The exact same code in a VB.NET Windows application, running on the same PC hosting the Web App, works fine. Any ideas?




Reply With Quote