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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get user accounts and groups from server with MS Access 2007

Status
Not open for further replies.

Shift838

IS-IT--Management
Jan 27, 2003
987
US
I want to input a server name and Access will execute a query or code to pull all local user accounts and local groups as well as memberships within each of the local groups and local user accounts.

Is this possible? If so, does anyone know how to do it or can direct me where to go to find out?
 
Well, one way (though probably not the best way):
[ol][li]Use Linked Tables from the SQL Servers.[/li]
[li]Create a table that lists each Server name with associated table names (names that matched how you linked them in Access[/li]
[li]Create a User Form (or update the user form you already have) to have a combo box that references the SQL Server names from your reference table created in #2.[/li]
[li]For your action(s), you would open or somehow view the linked tables for that particular Server. I suppose you could create a separate form/subform for this portion or else just include fields that would be adjusted in your VBA code to point to the correct linked tables.[/LI][/ol]

The other method would be probably to use an ADODB or some other connection with SQL queries generated via VBA to access the correct Server/Table(s) at the correct time - probably based on a conditional (perhaps Case) statement. I would think this method would be more efficient, but might be more involved in setting it up. More code, less wizards when compared to the first idea I mentioned.

Of course, none of this will work if you do not have access to the particular servers/tables. If it's for someone else, you'll have to make sure the login info to the SQL server (if using the 2nd method) is based on variables, and not static, so no issues between users. If for yourself only, I suppose it wouldn't matter.

Also, if you're at the level that you need all this information, I'm sure there are better available tools to get that information than building a custom Access database for it.

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top