Jim DeMarco
Jdemarco at hshhp.org
Fri Oct 3 13:08:30 CDT 2003
Is this what you're looking for? It returns the users login name. <code> Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Function GetUserName() As String 'This code was originally written by Dev Ashish. 'It is not to be altered or distributed, 'except as part of an application. 'You are free to use it in any application, 'provided the copyright notice is left unchanged. 'Code courtesy of Dev Ashish ' Returns the network login name Dim lngLen As Long, lngX As Long Dim strUserName As String strUserName = String$(254, 0) lngLen = 255 lngX = apiGetUserName(strUserName, lngLen) If lngX <> 0 Then GetUserName = Left$(strUserName, lngLen - 1) Else GetUserName = "" End If End Function </code> HTH, Jim DeMarco Director of Product Development HealthSource/Hudson Health Plan -----Original Message----- From: MarkH [mailto:lists at theopg.com] Sent: Friday, October 03, 2003 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Workgroup security and windows logins Hello All This may be a dum question, but here goes anyway... Is it possible to integrate the workgroup security that comes with Access with the Windows login details? I'd like to be able to secure the front and backend objects and grant relevant permissions to relevant groups etc. but I'd like the user to get straight into the application if they are logged into a windows account that’s in the workgroup. i.e. no password prompt. I know how to pick up the userID from windows etc. I just want to prevent the password prompt. If the windows login isn't in the workgroup list then they cant get. Sorry if this is a bit simple... Cheers Mark --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 01/09/2003 _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com *********************************************************************************** "This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited. If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message. Thank You". ***********************************************************************************