Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VbNullString equivalent in VFP?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01244386
Message ID:
01244388
Views:
18
I also tried that (but had the same result). The documentation I'm finding says that the vbNullString constant represents a string with a value of 0, but when I try "0", it doesn't work either.

I've been able to convert quite a few scripts to VFP and use them to manipulate AD for a client. The script to move a user from one OU to another in AD is pretty straight forward (about two lines), but it contains the use of vbNullString, which is the same line that is hanging on me. It could be that there is something else wrong, so I'm posting the code below (with some of the prep stuff removed, etc):
objConnection = CreateObject("ADODB.Connection")
objConnection.Open("Provider=ADSDSOObject") 
cSQL = "SELECT distinguishedName FROM 'LDAP://dc=hhccas,dc=local' WHERE objectCategory='user' and employeeID = '12345'"
objRecordSet = objConnection.Execute(cSQL)
IF objRecordset.RecordCount > 0
	objRecordSet.MoveFirst()
	cTmpOU = objRecordSet.Fields("distinguishedName").Value 
	objOU = GetObject("LDAP://"+SUBSTR(objRecordSet.Fields("distinguishedName").Value, ;
             AT(",OU",UPPER(objRecordSet.Fields("distinguishedName").Value))+1, ;
             LEN(objRecordSet.Fields("distinguishedName").Value)))         
        * In the actual code, I have some wait windows that tell me I am making it to the line below:
        *********************************************************************
        objOU.MoveHere("LDAP://"+SUBSTR(cTmpOU,1,AT(",OU",UPPER(cTmpOU))-1)+ ;
              ",OU=Students,OU=Disabled,dc=hhccas,dc=local", null )
        *********************************************************************
        * Right now I have 'null' where the vb script uses vbNullString.  I've tried "0", "", etc but no luck

ELSE
	WAIT WINDOW "No users are in this AD with the employeeID of 12345"
ENDIF
The code above works fine to the end if I comment out the highlighted (with asterisks) line above.

Any suggestions?

For more info, here's a sample script of what I am trying to do:
Set objOU = GetObject("LDAP://ou=sales,dc=na,dc=fabrikam,dc=com")
objOU.MoveHere "LDAP://cn=BarrAdam,OU=hr,dc=na,dc=fabrikam,dc=com", vbNullString
Thanks!

>Try
>NULL
>
>
>>I'm converting some vb scripts to use in VFP.
>>
>>I have a script that requires passing a value of vbNullString. However, according to VB documentation, it's not the same as "" or '' or Chr(0) or 0.
>>
>>Anyone know what I should use in it's place in VFP?
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform