Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Connection to TWO sql database

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-09-07 : 08:29:53
Seutens writes "i got a problem connection to TWO databases on a SQL server opening connecties (the info in the global asa is on the bottom of the message)

Set DBConn = server.CreateObject("ADODB.Connection")
DBConn.Open Application("DBConn_ConnectionString
Set DBConnForces = server.CreateObject("ADODB.Connection")
DBConnForces.Open Application "DBConnForces_ConnectionString")



Selection from the db
tb_Control is in the DBConn DB
tblForces is in the DBConnForces DB

strSelect = "SELECT * FROM tb_Control, tblForces WHERE Control_Zichtbaar=1 AND Control_ID_Machten="& intWebname &"AND Control_ID_Machten=ID_Forces ORDER BY Control_Datum"


Set rsResult = Server.CreateObject("ADODB.Recordset")

rsResult.Open strSelect , DBConn DBConnForces , adOpenKeyset ,adLockReadOnly

the last line isn't working
do you know if it can work?

Many Thanx in advance

Seutens
SID Internet
Belgian Armed Forces
http://www.mil.be/abl/welcomee.asp



ps global.asa
IDs passwords and login names changed to "empty" for securty

'==Visual InterDev Generated - startspan==
'--Project Data Connection
Application("DBConnForces_ConnectionString") = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=empty;Initial Catalog=Forces;Data Source=SIDNT;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=empty;User Id=empty;PASSWORD=empty;"
Application("DBConnForces_ConnectionTimeout") = 15
Application("DBConnForces_CommandTimeout") = 30
Application("DBConnForces_CursorLocation") = 3
Application("DBConnForces_RuntimeUserName") = "empty"
Application("DBConnForces_RuntimePassword") = "empty"
'--Project Data Connection
Application("DBConn_ConnectionString") = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=empty;Initial Catalog=quality;Data Source=SIDNT;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=emty;User Id=empty;PASSWORD=empty;"
Application("DBConn_ConnectionTimeout") = 15
Application("DBConn_CommandTimeout") = 30
Application("DBConn_CursorLocation") = 2
Application("DBConn_RuntimeUserName") = "empty"
Application("DBConn_RuntimePassword") = "empty""

   

- Advertisement -