Link to home
Start Free TrialLog in
Avatar of edjohn
edjohn

asked on

Connecting to oracle under two different uid's

Using ODBC ver2 to connect to an Oracle 7.3 database I get an error if I connect as a second user name, even if it is
a different database object. I can connect to two different
oracle databases without a problem.  I am using VB4 and the
standard database object.  Is there a way to dissconnect the
first session or something.  My code looks something like this:

dim db1 as database, db2 as database, rs as recordset

set db = opendatabase("MyDSn",false,true,"ODBC;uid=user1;pwd=pwd1")
set rs = db.openrecordset(sql,dbopensnapshot,dbsqlpassthrough)
opendatabase("MyDSn",false,true,"ODBC;uid=user2;pwd=pwd2")
set rs = db.openrecordset(sql2,dbopensnapshot,dbsqlpassthrough)

The error happens on the last line. If I reverse the order it is always the latter one that fails.
Avatar of y96andha
y96andha

Try creating another Workspace object, and open the other database in that Workspace.
ASKER CERTIFIED SOLUTION
Avatar of tward
tward

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial