tags:

views:

12

answers:

1

Hi

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")
%>
+1  A: 

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")
%>
Oded