If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Capture DB2 login name in MS Access?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-26-09, 12:23
willyboy willyboy is offline
Registered User
 
Join Date: Feb 2009
Posts: 2
Capture DB2 login name in MS Access?

I have an Access front-end db linked to DB2 tables. One of the tables has a "USER" field and I need to insert the userID of the person who logs in to DB2 and adds a record to this table (via my Access form that adds records to that particular DB2 table). So when they open my Access db and open the form to enter data, I want this data to be inserted along with their DB2 user name (or user login ID). I do not want their Windows or network name, it must be the DB2 username.
Reply With Quote
  #2 (permalink)  
Old 02-26-09, 13:05
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Try using CURRENT_USER or SESSION_USER values.
Reply With Quote
  #3 (permalink)  
Old 02-26-09, 13:05
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Fill the field with the DB2 special register CURRENT USER.

Andy
Reply With Quote
  #4 (permalink)  
Old 02-26-09, 14:18
willyboy willyboy is offline
Registered User
 
Join Date: Feb 2009
Posts: 2
CURRENT USER does not work

Apparently CURRENT USER (or SESSION USER) does not apply to IBM mainframe DB2???

If I update a field using CURRENT USER, or CURRENT_USER, or SESSION_USER, or (CURRENT USER), it gives an error

UPDATE [tablename]
SET [tablename].[fieldname] = CURRENT USER


I get error:
syntax error (missing operator) in query expression 'CURRENT USER'
Reply With Quote
  #5 (permalink)  
Old 02-26-09, 15:40
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by willyboy
Apparently CURRENT USER (or SESSION USER) does not apply to IBM mainframe DB2???
Apparently, you should have mentioned your DB2 version and platform earlier.

CURRENT CLIENT_USERID
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On