I am trying to use the DSN database connection in ASP301 and I couldn't get it working. Here is my code:
<% DSN = "ASP300" ' Name of the ODBC Connection
Set Conn = Server.CreateObject ("ADODB.Connection") ' Creates a connection to the database ADODB (Active X Data Objects B) Conn.ConnectionString="DSN=" & DSN Conn.Open
Set RS = Server.CreateObject("ADODB.Recordset") ' Tell it what recordsets / Queries to look at
RS.Open "CustomerT", Conn 'Tell it What Database to open (CustomerT) and what connection to use to Open It(Conn)
Response.write RS("FirstName") ' Will write the first name on the first record
RS.Close Set RS = Nothing Conn.Close Set Conn = Nothing
%>
Here is the error I am getting:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/ASP301/DSNDefault.asp, line 7
Line 7 is : Conn.Open
Any idea what is wrong?
Gary
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages 301.