編輯

共用方式為


Microsoft OLE DB Provider for Microsoft Active Directory Service

Applies to: Access 2013, Office 2013

The Microsoft Active Directory Service Interfaces (ADSI) Provider allows ADO to connect to heterogeneous directory services through ADSI. This gives ADO applications read-only access to the Microsoft Windows NT 4.0 and Microsoft Windows 2000 directory services, in addition to any LDAP-compliant directory service and Novell Directory Services. ADSI itself is based on a provider model, so if there is a new provider giving access to another directory, the ADO application will be able to access it seamlessly. The ADSI provider is free-threaded and unicode enabled.

Connection String Parameters

To connect to this provider, set the Provider argument of the ConnectionString property to:

 
ADSDSOObject 

Reading the Provider property will return this string as well.

Typical Connection String

A typical connection string for this provider is:

 
"Provider=ADSDSOObject;User ID=userName;Password=userPassword;" 

The string consists of these keywords:

Keyword

Description

Provider

Specifies the OLE DB Provider for Microsoft Active Directory Service.

User ID

Specifies the user name. If this keyword is omitted, then the current logon is used.

Password

Specifies the user password. If this keyword is omitted, then the current logon is used.

Command Text

A four-part command text string is recognized by the provider in the following syntax:

"Root; Filter; Attributes[; Scope]"

Value

Description

Root

Indicates the ADsPath object from which to start the search (that is, the root of the search).

Filter

Indicates the search filter in the RFC 1960 format.

Attributes

Indicates a comma-delimited list of attributes to be returned.

Scope

Optional. A String that specifies the scope of the search. Can be one of the following: Base — Search only the base object (root of the search).
OneLevel — Search only one level.
Subtree — Search the entire subtree.

For example:

 
"<LDAP://DC=ArcadiaBay,DC=COM>;(objectClass=*);sn, givenName; subtree" 

The provider also supports SQL SELECT for command text. For example:

 
"SELECT title, telephoneNumber From 'LDAP://DC=Microsoft, DC=COM' WHERE 
objectClass='user' AND objectCategory='Person'" 

The provider does not accept stored procedure calls or simple table names (for example, the CommandType property will always be adCmdText). See the Active Directory Service Interfaces documentation for a more complete description of the command text elements.

Recordset Behavior

The following tables list the features available on a Recordset object opened with this provider. Only the Static cursor type (adOpenStatic) is available.

For more detailed information about Recordset behavior for your provider configuration, run the Supports method and enumerate the Properties collection of the Recordset to determine whether provider-specific dynamic properties are present.

Availability of standard ADO Recordset properties:

Property

Availability

AbsolutePage

read/write

AbsolutePosition

read/write

ActiveConnection

read-only

BOF

read-only

Bookmark

read/write

CacheSize

read/write

CursorLocation

always adUseServer

CursorType

always adOpenStatic

EditMode

always adEditNone

EOF

read-only

Filter

read/write

LockType

read/write

MarshalOptions

not available

MaxRecords

read/write

PageCount

read-only

PageSize

read/write

RecordCount

read-only

Source

read/write

State

read-only

Status

read-only

Availability of standard ADO Recordset methods:

Method

Available?

AddNew

No

Cancel

No

CancelBatch

No

CancelUpdate

No

Clone

Yes

Close

Yes

Delete

No

GetRows

Yes

Move

Yes

MoveFirst

Yes

MoveLast

Yes

MoveNext

Yes

MovePrevious

Yes

NextRecordset

Yes

Open

Yes

Requery

Yes

Resync

Yes

Supports

Yes

Update

No

UpdateBatch

No