?
Solved

Connecting to oracle under two different uid's

Posted on 1997-06-11
2
Medium Priority
?
262 Views
Last Modified: 2006-11-17
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.
0
Comment
Question by:edjohn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Expert Comment

by:y96andha
ID: 1427127
Try creating another Workspace object, and open the other database in that Workspace.
0
 
LVL 7

Accepted Solution

by:
tward earned 400 total points
ID: 1427128
Maybe you just left it out but you will get an error on the second opendatabase because you are not setting an object equal to it.

Also have you tried looking at Oracle Objects for OLE?  That is what I use here and I have never had any problems with Oracle and Visual Basic.

If you need examples of using Oracle Objects for OLE just let me know as I do have a seperated BAS file that I use to do anything in Oracle.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question