Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting Script to VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01243994
Message ID:
01244011
Vues:
19
I appreciate all the help... Good news, I got the code to work as below:
objConnection = CreateObject("ADODB.Connection")
objConnection.Open("Provider=ADSDSOObject;User Id=hhccas\myusername;Password=mypassword")

cSQL = "SELECT distinguishedName,Name,displayname FROM 'LDAP://192.168.84.46/dc=hhccas,dc=local' WHERE objectCategory='user' "
objRecordSet = objConnection.Execute(cSQL)

objRecordSet.MoveFirst()

Do while NOT objRecordSet.EOF
    WAIT window objRecordSet.Fields("distinguishedName").Value nowait
    WAIT window objRecordSet.Fields("Name").Value nowait
    WAIT window  objRecordSet.Fields("displayName").Value nowait
    objRecordSet.MoveNext()
enddo
I had to change up the connection string somewhat and reference the execute command differently as well. Now it works identically to the vb script I was using.

I REALLY wish the syntax between the two was easier to convert... lol

Thanks again for all your help... I still have quite a bit more to do, so I'm sure I'll have more questions before it's over. :-)

>What is your system? I'm not sure I would be able to run this script even at work.
>
>However, at my older job we used a similar script as well, as I now recall. I can search for it, but it looks to me that your select command is somehow wrong, thus you get the error.
>
>Post both select commands you tried with your parameters.
>
>Are you sure your script worked fine as a script?
>
>>Hmmm... I still get an OLE "unspecified error" on the
objRecordSet = objCommand.Execute
line.
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform