Re: Eliminating multiple logins in VB6 with SQL svr



Here you go

http://vbnet.mvps.org/code/network/netusergetinfo.htm

regards

Ian

*** inavlid email address - change country code to full country name


"BruceL" <BruceL@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B0601C0C-D9D2-45AF-8AD7-B9AC04BE1AE0@xxxxxxxxxxxxxxxx
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


.



Relevant Pages

  • Eliminating multiple logins in VB6 with SQL svr
    ... I have a VB6 app running under client server and would like to eliminate the ... VB6 user login I created to validate users. ... Dim lSize As Long ...
    (microsoft.public.vb.general.discussion)
  • Authentication Sharing Across Apps
    ... For my part "B" question that I had (Login App was not returning ... authentication to calling app), I found the solution. ... Basically, in both the Login App and Calling App Web.Config, I did ... authenticated connection with SQL server. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Session object timout
    ... > specifying your OS and IIS level, but the phenomenon may be caused by the ... > app is running in. ... >> users must go through a login page. ... >> recreating the session object which holds the class I mentioned above. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Permit only one network logon per user
    ... You app is controlling its listener and allowing/disallowing the ... allow a second connection to it using the same creds. ... multiple simultaneous logons with the same username and password ... If user username try to login from a different machine, ...
    (microsoft.public.windows.server.security)
  • Re: Is_Member problem : Does user belong to custom Group
    ... In active directory: 1 - Created in Active directory a Windows group named ... 'MyDomainName/MyApplReadOnly' as Login Name and the same as User ... We can create a ROLE in the database and add the users. ...
    (microsoft.public.sqlserver.security)