Current User Problem

J

jmillerWV

Am moving to SQL and have run into a problem. In full Access user logs in and
code is able to get "CurrentUser()" anytime. When I try this in SQL with
either a .adp or .mdb front end linked to the data in SQL, I am unable to get
the current user. Is there a reason for this under SQL? Running SQL server
2000 and Access 2003. I have to know the user because of order entry and
tracking of changes ot each order. Thanks in advance for your assistance.
 
S

Sylvain Lafontaine

If I remember correctly, CurrentUser() is associated with protected Access
database (protected with a MDW security file) and return only the Access
login ID and not the Windows login Id or the System Login ID.

Use the following code to retrieve the system login ID:

http://www.mvps.org/access/api/api0008.htm

On SQL Server, you can also make a call to the stored procedure
SUSER_SNAME(); however, I don't know if this will work if your users are not
using each one their own login account.


--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
J

jmillerWV

Thanks for the response. Yes I am looking for a way to get the current user
of the database on a specific machine. Upon login a seperate screen loads in
the background that contains information about the current user, this info is
used on order screens, check in screens and so on. I found it is eaiser to
load this screen than to use lookups each time the info needs to be inserted
into a form. Again thanks for the response.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top