I have this in my declarations:
VB Code:
  1. Public CN As ADODB.Connection
  2. Public RS As ADODB.Recordset
I've used this code before, but only with 1 connection. I open the connection like this:
VB Code:
  1. Set CN = New ADODB.Connection
  2. CN.Provider = "Provider=SQLOLEDB.1;Password=xxxx;Persist Security Info=True;User ID=labuser;Initial Catalog=Nonconf;Data Source=myserver"
  3. CN.Open
My 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?

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