Search object error

Search object error

Post by tjeptjep » Tue, 01 Jul 2003 17:16:48



I have tried to search the user property by using IADsUser but I got
error
"Object variable or With block variable not set"

The code is

Dim iAdUser As IADsUser
sTarget = "LDAP://Server-001/CN=KUL+AA1,ou=user accounts,ou=user
directory,DC=Domain, DC=Name, DC=Com"
Set iAdUser = GetObject(sTarget)
 iAdUser.GetInfo

I think the error is caused by the CN name(KUL+AA1) because it will
return the result without error if I replace other CN name without the
"+" sign.

Your advice is really appreciated.

Thanks!

 
 
 

Search object error

Post by Richard Mueller [MVP » Wed, 02 Jul 2003 00:06:05



> I have tried to search the user property by using IADsUser but I got
> error
> "Object variable or With block variable not set"

> The code is

> Dim iAdUser As IADsUser
> sTarget = "LDAP://Server-001/CN=KUL+AA1,ou=user accounts,ou=user
> directory,DC=Domain, DC=Name, DC=Com"
> Set iAdUser = GetObject(sTarget)
>  iAdUser.GetInfo

> I think the error is caused by the CN name(KUL+AA1) because it will
> return the result without error if I replace other CN name without the
> "+" sign.

Hi,

Try using the backslash escape character with the "+":

sTarget = "LDAP://Server=--1/cn=KUN\+AA1,ou=user accounts,..."

--
Richard
Microsoft MVP Scripting and ADSI
http://www.rlmueller.net
--

 
 
 

1. Search Error when putting Search on a new page

I striped out the search code form default.htm and put it on a new
page.  It gives me an object error (line 1 Char 1 Code 0).
Also does anyone know what the LocID tag does?
Here is the code that is generating an error:
<html>
<HEAD>
<Title>Search</Title>
</HEAD>
<body>
         <SCRIPT>
         function SearchPage()
         {
             f = document.frmSearch;
             f.elements["SearchPage"].value = "1";
             if (!browseris.nav)
                 f.elements["SearchString"].value = "redirect";
             f.submit();
         }
         </SCRIPT>
         <FORM Name="frmSearch" ACTION="_vti_script/search.idq"
METHOD="GET" OnSubmit="SubmitSearch();return false;">
          <INPUT TYPE=HIDDEN ID="search200" NAME=CiCodePage
VALUE="windows-1252">
          <INPUT TYPE=HIDDEN NAME=Template VALUE="search">
          <INPUT TYPE=HIDDEN NAME=HighChar VALUE="0">
          <INPUT TYPE=HIDDEN NAME=DocLibDir VALUE="">
          <INPUT TYPE=HIDDEN NAME=SearchPage VALUE="0">
          <table border=0 cellpadding=2 cellspacing=0 width=100%>
           <tr>
            <td>
              <table cellpadding=0 cellspacing=0 border=0 width=100%>
              <TR><TD ID=onetidSearch>Search Documents</TD></TR>
              <tr><td><INPUT Type=TEXT NAME="SearchString" size=9
maxlength=255></td></tr>
              <tr><td align=right><a target="_self"
href="javascript:SubmitSearch()"><LocID
ID="onetIDGoSearch">Go</LocID></a>
              </td>
             </tr>
             </table>
            <a target="_self" href="javascript:SearchPage()"
ID=onetIDGoSearch><LocID ID="tpweb031">&#013;</LocID></a>
            </TD>
           </TR>
          </TABLE>
         </FORM> </body>
</html>

Any help would be appreciated....Susan

2. US-NC-PROJECT ADMINISTRATOR

3. Searching for deleted objects

4. 386SX-25, 4MB RAM... worthy of OS/2?

5. Search filter for changed objects in ADS

6. Performa 400 with Performa Plus Monitor

7. Searching for Objects in AD

8. How do I Close down a windows application?

9. global catalog and searching for AD objects

10. Searching for hidden LDAP objects

11. Searching for hidden Objects in

12. Filter to search only objects with "user" in the AdsPath

13. rights/permission to search for tombstone objects via ADSI