I have this in my declarations:
I've used this code before, but only with 1 connection. I open the connection like this:VB Code:
Public CN As ADODB.Connection Public RS As ADODB.RecordsetMy problem is, I have to open a connection to a different database while this connection is open. So I copied the declarations of the CN and RS objects and added a "2" after each. Now it won't even open the first connection claiming "Provider not found, It may not be installed". If I remove the declaration of the second connection object, it works fine. I cannot reuse the same connection on 2 different databases can I?VB Code:
Set CN = New ADODB.Connection CN.Provider = "Provider=SQLOLEDB.1;Password=xxxx;Persist Security Info=True;User ID=labuser;Initial Catalog=Nonconf;Data Source=myserver" CN.Open
What am I doing wrong? Why won't it allow me to have 2 connection objects?
Using: VB6, SP5 w/ ADO and SQL Server 2K




Reply With Quote