Solved

Connecting to oracle under two different uid's

Posted on 1997-06-11
2
257 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
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 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

932 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now