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,"ODB C;uid=user 1;pwd=pwd1 ")
set rs = db.openrecordset(sql,dbope nsnapshot, dbsqlpasst hrough)
opendatabase("MyDSn",false ,true,"ODB C;uid=user 2;pwd=pwd2 ")
set rs = db.openrecordset(sql2,dbop ensnapshot ,dbsqlpass through)
The error happens on the last line. If I reverse the order it is always the latter one that fails.
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
set rs = db.openrecordset(sql,dbope
opendatabase("MyDSn",false
set rs = db.openrecordset(sql2,dbop
The error happens on the last line. If I reverse the order it is always the latter one that fails.
Try creating another Workspace object, and open the other database in that Workspace.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.