PDA

View Full Version : Authentication issue..



sindhuja
09-07-2008, 06:43 AM
Hi All,

Is there a way to use the LAN username to the access login page.
I want to display the windows username as the access login username...

For ex, when logging into my system i use the username as Sindhu. I want to use the same username when using my access database...

Is this possible.. if so can be help me out in this...

Thanks in advance...!

-Sindhuja

Mavyak
09-07-2008, 08:11 AM
http://www.databasedev.co.uk/get_username_or_computername.html

CreganTur
09-08-2008, 05:18 AM
Here are 2 different ways to get it:

Using the Envirom method:

Function simplesusername()
Environ$("Username")
End Function

Using API:

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
Environ$ ("Username")

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
fOSUserName = left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function


I use the API function- it works really well.

sindhuja
09-08-2008, 08:15 AM
Thanks a lot..

sindhuja
09-08-2008, 04:01 PM
Hi All,

I have used the Environ("UserName") to get the windows username.

I tried the password which i used to login the system. Its showing me error...

Also tried the password i gave in the table even then showing me error...

Any idea on this...?

-Sindhuja

shamsam1
09-09-2008, 05:07 AM
just try user name as administrator