Click to See Complete Forum and Search --> : having 2 connections in one page?


Calmaris
11-22-2003, 07:07 AM
Problem: I'm using a global asa file(That's not the problem)
and in my page I have conn.open Application("connstring")
but I also need the old Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\(Address)

I get an error pretty much saying I can't have 2! So I took conn.open Application out to see what would happen and my sessions which I was using on the page were giving me errors, I'm guessing because it couldn't access the global.asa file. So I then decided to take out the conn.open("driver.....) and I got an ODBC error which I understand. So I can't have 2. I need to open the application to access the global file so I can use my user sessions for logging in and out, and open the ODBC link to my database to access the data. There has to be a way I can pool these 2 together. Thx in advance.

lillu
11-22-2003, 12:28 PM
Hi,

I don't think you could not link to different databases within ASP. (PHP/MySQL can handle this easily)

Specify all the connection definitions for all the databases you want to connect to in the global.asa file and also any global variables used by asp pages. It is very important to use unique connection variables for each connection so conn will not do but conn1 and conn2 do.

HTH,

Lillu

Calmaris
11-22-2003, 02:26 PM
K, so I would use Application right? Or Session_Onstart?
also I can ref the connection in the global file from another asp file but only with Session_Onstart. How can I do this with Application? I've tried but can't figure it out! I'm just learning about global files right now so bear with me. If someone could slap on some example code of how the connection string would look in the global file and how I would reference that in an asp file, that would be a lot of help! Thx in Advance