Hello there
using a vb script I am probing a container for objectes.
when i try to msgbox(object.objectclass) it gives a type mismatch error.
though it's supposed to be a string.
code below.
Any ideas?
'code
Set dso = GetObject("LDAP:")
samehname = "domain\useruser"
samehpass = "password"

Set obj1 = dso.OpenDSObject( "LDAP://DC=domain,DC=local", samehname,
samehpass,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
for each colitem in obj1
msgbox(colitem.name)

for each obj in colitem
msgbox(obj.objectclass)
if obj.objectclass = "organizationalUnit" then

msgbox(obj.name)
end if
next
next

object.classobject generates a type mismatch error by Tom

Tom
Tue Mar 02 07:38:49 CST 2004

I don't 'know' what you problem is, but in such situation
I substitute typename(variablename) to get a handle on
what's happening. My 'guess' here is that the object
property is returning a Null, but that's just a guess.

Tom Lavedas
===========

>-----Original Message-----
>Hello there
>using a vb script I am probing a container for objectes.
>when i try to msgbox(object.objectclass) it gives a type
mismatch error.
>though it's supposed to be a string.
>code below.
>Any ideas?
>'code
>Set dso = GetObject("LDAP:")
>samehname = "domain\useruser"
>samehpass = "password"
>
>Set obj1 = dso.OpenDSObject( "LDAP://DC=domain,DC=local",
samehname,
>samehpass,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
>for each colitem in obj1
>msgbox(colitem.name)
>
> for each obj in colitem
> msgbox(obj.objectclass)
>if obj.objectclass = "organizationalUnit" then
>
> msgbox(obj.name)
>end if
> next
>next
>
>
>
>
>.
>

Re: object.classobject generates a type mismatch error by Sameh

Sameh
Tue Mar 02 08:20:56 CST 2004

hi there
would you please be kind enough to tell me how to do that with vbscript?

"Tom Lavedas" <tlavedas@hotmail.remove.com> wrote in message
news:570d01c4005b$b1588950$a001280a@phx.gbl...
> I don't 'know' what you problem is, but in such situation
> I substitute typename(variablename) to get a handle on
> what's happening. My 'guess' here is that the object
> property is returning a Null, but that's just a guess.
>
> Tom Lavedas
> ===========
>
> >-----Original Message-----
> >Hello there
> >using a vb script I am probing a container for objectes.
> >when i try to msgbox(object.objectclass) it gives a type
> mismatch error.
> >though it's supposed to be a string.
> >code below.
> >Any ideas?
> >'code
> >Set dso = GetObject("LDAP:")
> >samehname = "domain\useruser"
> >samehpass = "password"
> >
> >Set obj1 = dso.OpenDSObject( "LDAP://DC=domain,DC=local",
> samehname,
> >samehpass,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
> >for each colitem in obj1
> >msgbox(colitem.name)
> >
> > for each obj in colitem
> > msgbox(obj.objectclass)
> >if obj.objectclass = "organizationalUnit" then
> >
> > msgbox(obj.name)
> >end if
> > next
> >next
> >
> >
> >
> >
> >.
> >



Re: object.classobject generates a type mismatch error by Tom

Tom
Wed Mar 03 07:36:19 CST 2004

Change ...

msgbox(obj.objectclass)

to

msgbox typename(obj.objectclass)

just for testing purposes. When you figure out what the
problem is - and repair it - delete the 'typename' string.

Tom Lavedas
===========

>-----Original Message-----
>hi there
>would you please be kind enough to tell me how to do that
with vbscript?
>
>"Tom Lavedas" <tlavedas@hotmail.remove.com> wrote in
message
>news:570d01c4005b$b1588950$a001280a@phx.gbl...
>> I don't 'know' what you problem is, but in such
situation
>> I substitute typename(variablename) to get a handle on
>> what's happening. My 'guess' here is that the object
>> property is returning a Null, but that's just a guess.
>>
>> Tom Lavedas
>> ===========
>>
>> >-----Original Message-----
>> >Hello there
>> >using a vb script I am probing a container for
objectes.
>> >when i try to msgbox(object.objectclass) it gives a
type
>> mismatch error.
>> >though it's supposed to be a string.
>> >code below.
>> >Any ideas?
>> >'code
>> >Set dso = GetObject("LDAP:")
>> >samehname = "domain\useruser"
>> >samehpass = "password"
>> >
>> >Set obj1 = dso.OpenDSObject
( "LDAP://DC=domain,DC=local",
>> samehname,
>> >samehpass,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
>> >for each colitem in obj1
>> >msgbox(colitem.name)
>> >
>> > for each obj in colitem
>> > msgbox(obj.objectclass)
>> >if obj.objectclass = "organizationalUnit" then
>> >
>> > msgbox(obj.name)
>> >end if
>> > next
>> >next
>> >
>> >
>> >
>> >
>> >.
>> >
>
>
>.
>