Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSN, linked tables

Status
Not open for further replies.

Andrei25

Technical User
Jan 23, 2006
10
DE
Hi!
my problem looks like this:
I have an Access app using linked tables from SQL Server.
for the UserManagement I need to know exactly who is connected to the DB.

I thought about creating a new DSN using info from a login form (DSN name, database, username and password) and re-link the tables.
problem is that I still have the SQL Server dialog box asking for the password when I append the tables.
using trusted_connection=yes in the connect string (also username and password), its not resolving because all the time I will have the same username and not changed when I login again.

any ideas?
thanks
 

You could create a table for UserID & Passwords to handle logging by your self and keep track on logins & logouts. But you 'll have to make them use your log out procedures. Using API or Environ("UserName") could get you the windows user name.

The other way would be to create user level security and use the CurrentUser method to get his UserID or

Code:
    Dim rs As ADODB.Recordset
    Dim S As String
    Set rs = CurrentProject.Connection.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
    With rs
        Do Until .EOF
                S = S & "Computer Name: " & Left(Trim(.Fields(0)), Len(Trim(.Fields(0))) - 1) & "     User: " & Left(Trim(.Fields(1)), Len(Trim(.Fields(1))) - 1) & Chr(10)
            .MoveNext
        Loop
        .Close
    End With
    Set rs = Nothing
    MsgBox S
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top