Jens, I am using 4.21 and have tried that syntax without success. Can you or someone else actually confirm some working code along these lines?


Break ON
$previousstate = SetOption( "WrapAtEOL", "ON" )

; Create the connection and command object.
$oConnection1 = CreateObject("ADODB.Connection")
? "@error @serror"
$oCommand1 = CreateObject("ADODB.Command")
? "@error @serror"

; Open the connection.
$oConnection1.Provider = "ADsDSOObject" ; This is the ADSI OLE-DB provider name
? "@error @serror"
$oConnection1.Properties("Password") = "ABC123xyz"
? "@error @serror"
$oConnection1.Properties("Encrypt Password") = not 0
? "@error @serror"
$oConnection1.Properties("User ID") = "domain\user1"
? "@error @serror"
$oConnection1.Open ("Active Directory Provider", "tycoelectronics\us035355", "ABC123xyz")
? "@error @serror"

; Create a command object for this connection.
$oCommand1.ActiveConnection = $oConnection1
? "@error @serror"

; Compose a search string.
$oCommand1.CommandText = "select name, objectClass from 'LDAP://us-tyco-e/DC=us,DC=tycoelectronics,DC=com' " +
"WHERE objectClass='user'" ; and objectClass<>'computer'"

; Execute the query.
$rs = $oCommand1.Execute
? "ex: @error @serror"


Result:

c:\data\scripts>C:\Data\Kix2001\KiX2001.421\kix32 test2.kix

0 The operation completed successfully.
0 The operation completed successfully.
0 The operation completed successfully.Password
ERROR : unexpected command!
Script: c:\data\scripts\test2.kix
Line : 13

[ 13. July 2003, 04:59: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/