Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Script to VFP
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01243994
Message ID:
01243996
Views:
17
>Hi Gang,
>
>I've finally got my scripts working the way I want them to, but now I need to get all the code over into VFP (instead of script) so I can handle some additional processes, etc.
>
>The code I am using in script (which works properly and does exactly what I want it to do is:
>
>Const ADS_SCOPE_SUBTREE = 2
>Set objConnection = CreateObject("ADODB.Connection")
>Set objCommand =   CreateObject("ADODB.Command")
>objConnection.Provider = "ADsDSOObject"
>objConnection.Open "Active Directory Provider"
>Set objCommand.ActiveConnection = objConnection
>objCommand.Properties("Page Size") = 1000
>objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
>objCommand.CommandText = _
>    "SELECT distinguishedName,Name,displayname FROM 'LDAP://dc=bogus,dc=local' WHERE objectCategory='user' " & _
>Set objRecordSet = objCommand.Execute
>objRecordSet.MoveFirst
>Do Until objRecordSet.EOF
>    Wscript.Echo objRecordSet.Fields("distinguishedName").Value
>    Wscript.Echo objRecordSet.Fields("Name").Value
>    Wscript.Echo objRecordSet.Fields("displayName").Value
>    objRecordSet.MoveNext
>Loop
>
>
>Does anyone have enough familiarity with script and VFP to tell me what syntax changes have to be made to work in VFP? Obviously I'll drop the "Set" command, etc. Other than that, I'm having a tough time. :-)
>
>Thanks,

This is very simple script. Remove all SET commands and change Wscript.Echo to ?

Do until you can change to do while. I don't recall if there is a difference.

Everything else should be left as is.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform