Classic ASP Connection
In my asp project,i have two databases开发者_开发技巧 in MS Access.Below code is working fine.But I need to add one more database with another dsn name.I have created dsn name efg and done the ODBC Connection for new databse in the control panel->Administrative tools.How can add the newly added dsn to the below code.
<%
session("connectionstring") = "dsn=abc"
set objconn = server.CreateObject("adodb.connection")
objconn.open session("connectionstring")
%>
Just create a second connection for the second dsn:
<%
' First dsn/connection
session("connectionstring") = "dsn=abc"
set objconn = server.CreateObject("adodb.connection")
objconn.open session("connectionstring")
' Second dsn/connection
session("connectionstring2") = "dsn=newDSN"
set objconn2 = server.CreateObject("adodb.connection")
objconn2.open session("connectionstring2")
%>
精彩评论