I'm trying to update a database via ODBC in ASP:

<%@ Page LANGUAGE="VB"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Configuration" %>

Dim objConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("ODBCNAME").ConnectionString)

'example query
Dim strSQL As String = "update foo set bar='BAZ'" 
Dim objCmd As New SqlCommand(strSQL, objConn)

    Response.Write("Record updated")
Catch e As Exception
End Try


Where web.config has:

   <add name="ODBCNAME" connectionString="server=ExampleServerName;" providerName="System.Data.Odbc" />

When I execute this I get the error on the objCOnn.Open() line:

System.ComponentModel.Win32Exception: The network path was not found.

The ODBC data source is created, testing and working with other stand alone applications (closed source), and I can test the connection via the ODBC Settings, which works.

How can I connect to this database from my code? Or how can I debug this problem?

Related posts

Recent Viewed