wisenhiemer
wisenhiemer

Reputation: 155

Connecting to Active Directory from MS Access?

I am currently trying to pull User info from Active directory into MS Access Table. I am a bit confused if this is done by SQL query or VBA.

Upvotes: 0

Views: 14716

Answers (1)

Dai
Dai

Reputation: 155075

SQL is used for working with relational databases and Access lets you run SQL against both itself and any ODBC relational data source.

Active Directory is also a database, but it is not a relational database (i.e. one that uses tables), instead it's a form of graph-database known as a hierarchical-database, with multiple root nodes. Each node has a set of properties, an ACL, and multiple child nodes. Nodes can be Containers, Users, Computers, Organizational Units, and so on.

To query Active Directory you use LDAP queries (as Active Directory is an implementation of LDAP).

VBA in Access is compatible with VBScript that uses LDAP, so you use techniques like these: Querying Active Directory using VBScript

Confusingly, ADODB (Microsoft's COM-based database API) can be used to target both relational and non-relational databases. Note that in this example (from the above-linked question and answer) the ADODB.Connection is to LDAP://RootDSE instead of an Access or SQL Database, but the other concepts (Connections, Commands, and Parameters) are the same.

Upvotes: 3

Related Questions