winforms - Authenticate user using Active Directory/Windows authentication in MS Access 2007 -


we have application built on msaccess 2007. want add new user login concept application. want authenticate user using active directory/windows authentication.i want create log file user. (like .net applications using forms authentication) how do on ms access 2007.

furthermore application runs 24 hours, not shutdown. there can multiple users using application. said application used 24/7, there multiple shifts running , different users login , logout. during user login , logout session, need keep track of log particular user. application uses sql server 2005 database server.
advise great me, develop kind of module on ms access 2007

since user has log on pc, can grab logon using code http://www.mvps.org/access/api/api0008.htm:

' code written dev ashish. ' not altered or distributed, ' except part of application. ' free use in application, ' provided copyright notice left unchanged. ' ' code courtesy of ' dev ashish ' private declare function apigetusername lib "advapi32.dll" alias _     "getusernamea" (byval lpbuffer string, nsize long) long  function fosusername() string ' returns network login name dim lnglen long, lngx long dim strusername string     strusername = string$(254, 0)     lnglen = 255     lngx = apigetusername(strusername, lnglen)     if ( lngx > 0 )         fosusername = left$(strusername, lnglen - 1)     else         fosusername = vbnullstring     end if end function 

and, following vbs script, should work in access fine also:

displays group membership , active directory location

the following code can run display group membership of active directory group , let know each member’s ldap distinguished name. output name text file group name , include members , location in active directory. copy txt file , rename .vbs enjoy!

set objgroup = getobject(“ldap://cn=groupname,ou=ouname,dc=domainname,dc=local“) set objfilesystem = createobject(“scripting.filesystemobject”) set objfile = objfilesystem.opentextfile(objgroup.get(“name”) & ” – members.txt“, 2, true, 0) each objmember in objgroup.members   objfile.writeline objmember.get(“samaccountname”) & vbtab & _     objmember.get(“cn”) & vbtab & _     objmember.parent next set objfile = nothing set objfilesystem = nothing set objgroup = nothing 

Comments