Eliminating multiple logins in VB6 with SQL svr
- From: BruceL <BruceL@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 8 Apr 2008 17:05:01 -0700
I have a VB6 app running under client server and would like to eliminate the
VB6 user login I created to validate users. Users have already logged in
through active directory so their login is valid by the time they want to
open my VB6 app.
Currently I have a SQL server table that holds my user names and passwords.
When the user opens my app they enter the user name and password which I
validate from my table to allow entry. In the login screen I use an API call
to GetUserName which plugs the current computers user name in the name field
and if I have set up their user name in my SQL svr table they only need to
enter their password to continue but it is still a separate login.
I need to check the user name when my app starts to limit their recordset
information to say, different states or counties, so I would still need a SQL
svr table that I could match their active directory name to. I would
initially put their active directory user names into the table to match up
with when a user opens my app and then I wouldn't need the additional VB6
login.
So, in summary, when a user opens my app, how do I get their active
directory user name so I can then match it to my SQL svr table?
I don't think my API call would get the active directory user name or would
it? I have listed the API call below.
GetUserName
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
txtUserName.Text = Left$(sBuffer, lSize)
Else
txtUserName.Text = vbNullString
End If
Any help on this would be great. I usually know just about enough to get
myself into trouble.
Thanks,
--
BruceL
.
- Follow-Ups:
- Re: Eliminating multiple logins in VB6 with SQL svr
- From: Ian Williams
- Re: Eliminating multiple logins in VB6 with SQL svr
- Prev by Date: Re: search plain text files including wildcards
- Next by Date: Re: How can I tell if my program is running in the IDE
- Previous by thread: OT - Score One For The Good Guys
- Next by thread: Re: Eliminating multiple logins in VB6 with SQL svr
- Index(es):
Relevant Pages
|