0
我遇到了以下VBS为什么VBScript中失败,出现一个“类型不匹配”的错误?
set conn = createobject("ADODB.Connection")
Conn.Provider = "ADsDSOObject"
Conn.Open "ADs Provider"
strQueryDL = "<LDAP://company.address.com/cn=address>;(&(objectCategory=person)(objectClass=user));distinguishedName,adspath;subtree"
set objCmd = createobject("ADODB.Command")
objCmd.ActiveConnection = Conn
objCmd.Properties("SearchScope") = 2 ' we want to search everything
objCmd.Properties("Page Size") = 500 ' and we want our records in lots of 500
objCmd.CommandText = strQueryDL
Set objRs = objCmd.Execute
While Not objRS.eof
wscript.echo objRS.Fields("distinguishedName")
' do something with objRS.Fields("distinguishedName")'
objRS.MoveNext
Wend
请帮我困难,我刚开始vbscripting,这是在这个网站上的答案。
根据上面的线/代码wscript.echo objRS.Fields("distinguishedName")
的错误。如何显示出外地或将其转换为显示?
你试过'objRS.Fields distinguishedName'!? – 2013-05-21 10:11:25
不起作用。给我'语句的预期结束' – user2285115