Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How in access 97 do i find the current logged in Oracle 7.3 user 2

Status
Not open for further replies.

damabs26

Technical User
Jun 14, 2002
4
GB
I am trying to write a comand which will do the following.

If user not = ?????
Then close form

That is ruffly what i am after but i can't find anyway of finding out the name of the logged in oracle user. I can get the current access97 user and the NT 4 logged in user but i need the oracle user as this is how this perticular database is secured via oracle user accounts.
Any help will be appriciated.
 
Issue an Oracle query (recordset):

'select user from dual;'

(User is an Oracle function, not Access).
 
I am having a similar problem.

We are in the process of converting our Access databases into an Access front-end and Oracle back-end setup. I have several pieces of code that call the CurrentUser() function in Access, but the powers that be want to use the Oracle security instead of the Access security. So now when I call the CurrentUser() function it returns "Admin" instead of the actual user's name (the users are logging into Oracle). I found this post but don't understand what BveOracle is trying to say. Could someone help explain how I can return the current Oracle user through code behind an Access form.

Thank you in advance,

BAKEMAN [pimp]
 
There are two ways you can do this:

1. Set up Access security so that the usernames/passwords are identical to the Oracle counterparts. If they are, your users will automatically(!!!) log into Oracle with their current Access login. I have done this here.


2. What he's saying is create a pass-through query, which you will have to set up to pass-through to the Oracle db server. For the "SQL" for this query, put "SELECT USER FROM DUAL;". When you open the query, it will return one record with the current (Oracle DB user's) username. This is a perfect situation for a DLookup, or some sort of wrapper function. Once you have a wrapper function set up, replace all CurrentUser() calls with customCurrentUser(), or whatever you call the function.
 
About option #1, it somewhat invalidates the Oracle security--because all Access usernames/passwords are crackable, if you store the same usernames/passwords as you use for Oracle, then you are (theoretically) storing a userlist of valid usernames and passwords.

So if they didn't want to use Access security in the first place, maybe it's best that you not go with option#1.
 
Thank you!! Thank you!! Thank you!!

foolio12 your a life saver.

Have a star from me

BAKEMAN [pimp]

P.S.

Thanks to Bveoracle as well. I just couldn't understand what you were trying to tell me to do. I used your original suggestion and it worked great. Have a star too!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top