Solved

Connecting to oracle under two different uid's

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

742 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