| Author |
Message |
Rudy Steyaert
Guest
|
Posted:
Tue Dec 21, 2004 12:39 am Post subject:
Is this a bug in ADO |
|
|
After a ADO call this works
v=Rs.Fields("ProxyAddresses").value
s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment:
'Rs.Fields(...).value'
Can anyone help with this one please ? |
|
| Back to top |
|
 |
Ray Costanzo [MVP]
Guest
|
Posted:
Tue Dec 21, 2004 12:43 am Post subject:
Re: Is this a bug in ADO |
|
|
Are you sure you don't have a Split() in there somewhere or something? I
can't imagine how the first snippet would work.
Ray at work
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...
| Quote: | After a ADO call this works
v=Rs.Fields("ProxyAddresses").value
s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment:
'Rs.Fields(...).value'
Can anyone help with this one please ?
|
|
|
| Back to top |
|
 |
Rudy Steyaert
Guest
|
Posted:
Tue Dec 21, 2004 5:00 am Post subject:
Re: Is this a bug in ADO |
|
|
Nope, it works exactly like it's written hereunder.
It's a bit of code that I'm 'trying' to complete to display all
proxy-addresses of an AD mail-enabled contact.
The type of the Rs.Fields("ProxyAddresses") field is 12 = variant.
But there is also an LBound an UBound value that is correct for each record
I found. So I would think it's an array.
Totally puzzled by this one :o)
I must be missing something here.
Regards
Rudy not at work
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...
| Quote: | Are you sure you don't have a Split() in there somewhere or something? I
can't imagine how the first snippet would work.
Ray at work
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...
After a ADO call this works
v=Rs.Fields("ProxyAddresses").value
s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment:
'Rs.Fields(...).value'
Can anyone help with this one please ?
|
|
|
| Back to top |
|
 |
Al Dunbar [MS-MVP]
Guest
|
Posted:
Tue Dec 21, 2004 9:08 am Post subject:
Re: Is this a bug in ADO |
|
|
"Rudy Steyaert" <rudy_steyaert@hotmail.com> wrote in message
news:%23$nN2fu5EHA.3616@TK2MSFTNGP11.phx.gbl...
| Quote: | Nope, it works exactly like it's written hereunder.
It's a bit of code that I'm 'trying' to complete to display all
proxy-addresses of an AD mail-enabled contact.
The type of the Rs.Fields("ProxyAddresses") field is 12 = variant.
But there is also an LBound an UBound value that is correct for each
record
I found. So I would think it's an array.
Totally puzzled by this one :o)
I must be missing something here.
Regards
Rudy not at work
|
I am a bit puzzled, too. Given the first snippet works, it is tempting to
assume that the given value is, indeed an array. And most array expressions
can be qualified by a subscript to pick out one of its elements.
I would doubt that it would be a bug in ADO, as most
methods/properties/functions that return a value are generally unable to
detect the context in which they have been called. It seems more likely to
me that something unusual/unexpected is happening at the vbscript level.
Alternately, could it be that the "value" property is coded in a language
that supports overloading of parameters, such that, when a parameter is
passed, it means something different? This seems to be roughly what the
error message is telling us.
Here are a couple of things you could try (just for the heck of it):
s=Rs.Fields("ProxyAddresses").value((0))
with Rs.Fields("ProxyAddresses").value
s = .(0)
end with
v=Rs.Fields("ProxyAddresses").value
s=v(0)
Please post back the results if you try this...
/Al not here
| Quote: | "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...
Are you sure you don't have a Split() in there somewhere or something?
I
can't imagine how the first snippet would work.
Ray at work
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...
After a ADO call this works
v=Rs.Fields("ProxyAddresses").value
s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment:
'Rs.Fields(...).value'
Can anyone help with this one please ?
|
|
|
| Back to top |
|
 |
Al Dunbar [MS-MVP]
Guest
|
Posted:
Tue Dec 21, 2004 10:27 am Post subject:
Re: Is this a bug in ADO |
|
|
"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message
news:%23Kw7ppw5EHA.4072@TK2MSFTNGP10.phx.gbl...
| Quote: |
"Rudy Steyaert" <rudy_steyaert@hotmail.com> wrote in message
news:%23$nN2fu5EHA.3616@TK2MSFTNGP11.phx.gbl...
|
<snip>
| Quote: | Here are a couple of things you could try (just for the heck of it):
s=Rs.Fields("ProxyAddresses").value((0))
with Rs.Fields("ProxyAddresses").value
s = .(0)
end with
v=Rs.Fields("ProxyAddresses").value
s=v(0)
|
Also:
s=Rs.Fields("ProxyAddresses")(0)
| Quote: | Please post back the results if you try this...
/Al not here
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...
Are you sure you don't have a Split() in there somewhere or something?
I
can't imagine how the first snippet would work.
Ray at work
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...
After a ADO call this works
v=Rs.Fields("ProxyAddresses").value
s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment:
'Rs.Fields(...).value'
Can anyone help with this one please ?
|
|
|
| Back to top |
|
 |
Rudy Steyaert
Guest
|
Posted:
Wed Dec 22, 2004 12:47 am Post subject:
Re: Is this a bug in ADO |
|
|
Hello Al
Still investigating, but none of the proposed syntaxes work, except for the
v=Rs.Fields("ProxyAddresses").value
s=v(0)
Here is some sample-code to read other telephone-entries for a contact that
has a given e-mail address in the proxy-addresses list
You can try it for yourself.
Strange if you ask me !
Regards
Rudy Steyaert
<%
If (ShowOtherTelephones("someemailt@domain.com")) Then
Response.Write ("Found")
Else
Response.Write ("Not found")
End If
Function ShowOtherTelephones(email)
Set Conn=Server.CreateObject("ADODB.Connection")
Set Com=Server.CreateObject("ADODB.Command")
Set Rs=Server.CreateObject("ADODB.Recordset")
Conn.Provider="ADsDSOObject"
Conn.Open "ADs Provider"
Com.ActiveConnection=Conn
Com.CommandText="<LDAP://DC=MYDOMAIN,DC=local>;(&(objectCategory=Contact)(Proxyaddresses=smtp:"&email&"));otherTelephone;subtree" Set Rs = Com.Execute Found=not Rs.EOF If Found Then s=Rs.Fields("otherTelephone").value response.write (s(0)) ' test=Rs.Fields("otherTelephone").value(0) ' uncomment to make the pagecrash ... for each x in Rs.Fields("otherTelephone").value response.write (x)&"<BR>" next End If Rs.Close Conn.Close Set Rs=Nothing Set Com=Nothing Set Conn=Nothing ShowOtherTelephones=FoundEnd Function%>"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in messagenews:u4SAcVx5EHA.1564@TK2MSFTNGP09.phx.gbl...>> "Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message> news:%23Kw7ppw5EHA.4072@TK2MSFTNGP10.phx.gbl...>>>> "Rudy Steyaert" <rudy_steyaert@hotmail.com> wrote in message>> news:%23$nN2fu5EHA.3616@TK2MSFTNGP11.phx.gbl...>> <snip>>>> Here are a couple of things you could try (just for the heck of it):>>>> s=Rs.Fields("ProxyAddresses").value((0))>>>> with Rs.Fields("ProxyAddresses").value>> s = .(0)>> end with>>>> v=Rs.Fields("ProxyAddresses").value>> s=v(0)>> Also:>> s=Rs.Fields("ProxyAddresses")(0)>>>> Please
post back the results if you try this...>>>> /Al not here>>>> > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in>> > message news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...>> > > Are you sure you don't have a Split() in there somewhere orsomething?>> I>> > > can't imagine how the first snippet would work.>> > >>> > > Ray at work>> > >>> > > "Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message>> > > news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...>> > >> After a ADO call this works>> > >>>> > >> v=Rs.Fields("ProxyAddresses").value>> > >> s=v(0)>> > >>>> > >> and this gives an error>> > >>>> > >> s=Rs.Fields("ProxyAddresses").value(0)>> > >>>> > >> Microsoft VBScript runtime error '800a01c2'>> > >> Wrong number of arguments or invalid property assignment:>> > >> 'Rs.Fields(...).value'>> > >>>> > >> Can anyone help with this one please ?>> > >>>> > >>>> > >>> > >>> >>> >>>>>>> |
|
| Back to top |
|
 |
Al Dunbar [MS-MVP]
Guest
|
Posted:
Wed Dec 22, 2004 11:41 pm Post subject:
Re: Is this a bug in ADO |
|
|
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:%234i05045EHA.3616@TK2MSFTNGP11.phx.gbl...
| Quote: | Hello Al
Still investigating, but none of the proposed syntaxes work, except for
the
v=Rs.Fields("ProxyAddresses").value
s=v(0)
Here is some sample-code to read other telephone-entries for a contact
that
has a given e-mail address in the proxy-addresses list
You can try it for yourself.
Strange if you ask me !
|
script got a bit garbled in posting, so I won't try it. Are you saying that
the above syntax works for fields other htan "ProxyAddresses"? If so, then I
agree it is strange. It will be interesting if someone can point out a
reason/cause for this other than it being a "bug".
/Al
| Quote: | Regards
Rudy Steyaert
%
If (ShowOtherTelephones("someemailt@domain.com")) Then
Response.Write ("Found")
Else
Response.Write ("Not found")
End If
Function ShowOtherTelephones(email)
Set Conn=Server.CreateObject("ADODB.Connection")
Set Com=Server.CreateObject("ADODB.Command")
Set Rs=Server.CreateObject("ADODB.Recordset")
Conn.Provider="ADsDSOObject"
Conn.Open "ADs Provider"
Com.ActiveConnection=Conn
Com.CommandText="<LDAP://DC=MYDOMAIN,DC=local>;(&(objectCategory=Contact)(Pr |
oxyaddresses=smtp:"&email&"));otherTelephone;subtree" Set Rs = Com.Execute
Found=not Rs.EOF If Found Then s=Rs.Fields("otherTelephone").value
response.write (s(0)) ' test=Rs.Fields("otherTelephone").value(0) '
uncomment to make the pagecrash ... for each x in
Rs.Fields("otherTelephone").value response.write (x)&"<BR>" next End If
Rs.Close Conn.Close Set Rs=Nothing Set Com=Nothing Set Conn=Nothing
ShowOtherTelephones=FoundEnd Function%>"Al Dunbar [MS-MVP]"
<alan-no-drub-spam@hotmail.com> wrote in
messagenews:u4SAcVx5EHA.1564@TK2MSFTNGP09.phx.gbl...>> "Al Dunbar [MS-MVP]"
<alan-no-drub-spam@hotmail.com> wrote in message>
news:%23Kw7ppw5EHA.4072@TK2MSFTNGP10.phx.gbl...>>>> "Rudy Steyaert"
<rudy_steyaert@hotmail.com> wrote in message>>
news:%23$nN2fu5EHA.3616@TK2MSFTNGP11.phx.gbl...>> <snip>>>> Here are a
couple of things you could try (just for the heck of it):>>>>
s=Rs.Fields("ProxyAddresses").value((0))>>>> with
Rs.Fields("ProxyAddresses").value>> s = .(0)>> end with>>>>
v=Rs.Fields("ProxyAddresses").value>> s=v(0)>> Also:>>
s=Rs.Fields("ProxyAddresses")(0)>>>> Please post back the results if you try
this...>>>> /Al not here>>>> > "Ray Costanzo [MVP]" <my first name at lane
34 dot commercial> wrote in>> > message
news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...>> > > Are you sure you don't
have a Split() in there somewhere orsomething?>> I>> > > can't imagine how
the first snippet would work.>> > >>> > > Ray at work>> > >>> > > "Rudy
Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message>> > >
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...>> > >> After a ADO call this
works>> > >>>> > >> v=Rs.Fields("ProxyAddresses").value>> > >> s=v(0)>> >
| Quote: | and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)>> > >>>> > >> Microsoft VBScript |
runtime error '800a01c2'>> > >> Wrong number of arguments or invalid
property assignment:>> > >> 'Rs.Fields(...).value'>> > >>>> > >> Can anyone
help with this one please ?>> > >>>> > >>>> > >>> > >>> >>> >>>>>>>
> |
|
| Back to top |
|
 |
Rudy Steyaert
Guest
|
Posted:
Thu Dec 23, 2004 4:15 am Post subject:
Re: Is this a bug in ADO |
|
|
Hi Al
If what I see beneath is the way you see the script I orginally posted I
would not call it garbled, I know stronger words for this (though not in
English. Happily :O)
Well, no, I just wanted to show it does not work for other multi-valued
fields in AD either. The otherTelephones is just *another* example of this
weird behaviour in VBScript on an ASP-page (just wanted to stress out that
Exchange does not need to be involved).
Rudy
"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message
news:eyqeD2E6EHA.3756@TK2MSFTNGP14.phx.gbl...
| Quote: |
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:%234i05045EHA.3616@TK2MSFTNGP11.phx.gbl...
Hello Al
Still investigating, but none of the proposed syntaxes work, except for
the
v=Rs.Fields("ProxyAddresses").value
s=v(0)
Here is some sample-code to read other telephone-entries for a contact
that
has a given e-mail address in the proxy-addresses list
You can try it for yourself.
Strange if you ask me !
script got a bit garbled in posting, so I won't try it. Are you saying
that
the above syntax works for fields other htan "ProxyAddresses"? If so, then
I
agree it is strange. It will be interesting if someone can point out a
reason/cause for this other than it being a "bug".
/Al
Regards
Rudy Steyaert
%
If (ShowOtherTelephones("someemailt@domain.com")) Then
Response.Write ("Found")
Else
Response.Write ("Not found")
End If
Function ShowOtherTelephones(email)
Set Conn=Server.CreateObject("ADODB.Connection")
Set Com=Server.CreateObject("ADODB.Command")
Set Rs=Server.CreateObject("ADODB.Recordset")
Conn.Provider="ADsDSOObject"
Conn.Open "ADs Provider"
Com.ActiveConnection=Conn
Com.CommandText="<LDAP://DC=MYDOMAIN,DC=local>;(&(objectCategory=Contact)(Pr
oxyaddresses=smtp:"&email&"));otherTelephone;subtree" Set Rs = Com.Execute
Found=not Rs.EOF If Found Then s=Rs.Fields("otherTelephone").value
response.write (s(0)) ' test=Rs.Fields("otherTelephone").value(0) '
uncomment to make the pagecrash ... for each x in
Rs.Fields("otherTelephone").value response.write (x)&"<BR>" next End If
Rs.Close Conn.Close Set Rs=Nothing Set Com=Nothing Set Conn=Nothing
ShowOtherTelephones=FoundEnd Function%>"Al Dunbar [MS-MVP]"
alan-no-drub-spam@hotmail.com> wrote in
messagenews:u4SAcVx5EHA.1564@TK2MSFTNGP09.phx.gbl...>> "Al Dunbar
[MS-MVP]"
alan-no-drub-spam@hotmail.com> wrote in message
news:%23Kw7ppw5EHA.4072@TK2MSFTNGP10.phx.gbl...>>>> "Rudy Steyaert"
rudy_steyaert@hotmail.com> wrote in message
news:%23$nN2fu5EHA.3616@TK2MSFTNGP11.phx.gbl...>> <snip>>>> Here are a
couple of things you could try (just for the heck of it):
s=Rs.Fields("ProxyAddresses").value((0))>>>> with
Rs.Fields("ProxyAddresses").value>> s = .(0)>> end with
v=Rs.Fields("ProxyAddresses").value>> s=v(0)>> Also:
s=Rs.Fields("ProxyAddresses")(0)>>>> Please post back the results if you
try
this...>>>> /Al not here>>>> > "Ray Costanzo [MVP]" <my first name at lane
34 dot commercial> wrote in>> > message
news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...>> > > Are you sure you don't
have a Split() in there somewhere orsomething?>> I>> > > can't imagine how
the first snippet would work.>> > >>> > > Ray at work>> > >>> > > "Rudy
Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...>> > >> After a ADO call this
works>> > >>>> > >> v=Rs.Fields("ProxyAddresses").value>> > >> s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)>> > >>>> > >> Microsoft VBScript
runtime error '800a01c2'>> > >> Wrong number of arguments or invalid
property assignment:>> > >> 'Rs.Fields(...).value'>> > >>>> > >> Can
anyone
help with this one please ?
|
|
|
| Back to top |
|
 |
Al Dunbar [MS-MVP]
Guest
|
Posted:
Thu Dec 23, 2004 4:42 am Post subject:
Re: Is this a bug in ADO |
|
|
"Rudy Steyaert" <rudy_steyaert@hotmail.com> wrote in message
news:ej3iSQH6EHA.616@TK2MSFTNGP09.phx.gbl...
| Quote: | Hi Al
If what I see beneath is the way you see the script I orginally posted I
would not call it garbled, I know stronger words for this (though not in
English. Happily :O)
Well, no, I just wanted to show it does not work for other multi-valued
fields in AD either. The otherTelephones is just *another* example of
this
weird behaviour in VBScript on an ASP-page (just wanted to stress out that
Exchange does not need to be involved).
|
The fact that it is consistent implies less of a problem to me than if it
were the problem only for one multi-valued attribute. Still, it would be
nice to hear of a reasonable explanation...
/Al
| Quote: | Rudy
"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message
news:eyqeD2E6EHA.3756@TK2MSFTNGP14.phx.gbl...
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:%234i05045EHA.3616@TK2MSFTNGP11.phx.gbl...
Hello Al
Still investigating, but none of the proposed syntaxes work, except for
the
v=Rs.Fields("ProxyAddresses").value
s=v(0)
Here is some sample-code to read other telephone-entries for a contact
that
has a given e-mail address in the proxy-addresses list
You can try it for yourself.
Strange if you ask me !
script got a bit garbled in posting, so I won't try it. Are you saying
that
the above syntax works for fields other htan "ProxyAddresses"? If so,
then
I
agree it is strange. It will be interesting if someone can point out a
reason/cause for this other than it being a "bug".
/Al
Regards
Rudy Steyaert
%
If (ShowOtherTelephones("someemailt@domain.com")) Then
Response.Write ("Found")
Else
Response.Write ("Not found")
End If
Function ShowOtherTelephones(email)
Set Conn=Server.CreateObject("ADODB.Connection")
Set Com=Server.CreateObject("ADODB.Command")
Set Rs=Server.CreateObject("ADODB.Recordset")
Conn.Provider="ADsDSOObject"
Conn.Open "ADs Provider"
Com.ActiveConnection=Conn
Com.CommandText="<LDAP://DC=MYDOMAIN,DC=local>;(&(objectCategory=Contact)(Pr
oxyaddresses=smtp:"&email&"));otherTelephone;subtree" Set Rs =
Com.Execute
Found=not Rs.EOF If Found Then s=Rs.Fields("otherTelephone").value
response.write (s(0)) ' test=Rs.Fields("otherTelephone").value(0) '
uncomment to make the pagecrash ... for each x in
Rs.Fields("otherTelephone").value response.write (x)&"<BR>" next End
If
Rs.Close Conn.Close Set Rs=Nothing Set Com=Nothing Set Conn=Nothing
ShowOtherTelephones=FoundEnd Function%>"Al Dunbar [MS-MVP]"
alan-no-drub-spam@hotmail.com> wrote in
messagenews:u4SAcVx5EHA.1564@TK2MSFTNGP09.phx.gbl...>> "Al Dunbar
[MS-MVP]"
alan-no-drub-spam@hotmail.com> wrote in message
news:%23Kw7ppw5EHA.4072@TK2MSFTNGP10.phx.gbl...>>>> "Rudy Steyaert"
rudy_steyaert@hotmail.com> wrote in message
news:%23$nN2fu5EHA.3616@TK2MSFTNGP11.phx.gbl...>> <snip>>>> Here are a
couple of things you could try (just for the heck of it):
s=Rs.Fields("ProxyAddresses").value((0))>>>> with
Rs.Fields("ProxyAddresses").value>> s = .(0)>> end with
v=Rs.Fields("ProxyAddresses").value>> s=v(0)>> Also:
s=Rs.Fields("ProxyAddresses")(0)>>>> Please post back the results if you
try
this...>>>> /Al not here>>>> > "Ray Costanzo [MVP]" <my first name at
lane
34 dot commercial> wrote in>> > message
news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...>> > > Are you sure you
don't
have a Split() in there somewhere orsomething?>> I>> > > can't imagine
how
the first snippet would work.>> > >>> > > Ray at work>> > >>> > > "Rudy
Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...>> > >> After a ADO call
this
works>> > >>>> > >> v=Rs.Fields("ProxyAddresses").value
s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)>> > >>>> > >> Microsoft VBScript
runtime error '800a01c2'>> > >> Wrong number of arguments or invalid
property assignment:>> > >> 'Rs.Fields(...).value'>> > >>>> > >> Can
anyone
help with this one please ?
|
|
|
| Back to top |
|
 |
Rudy Steyaert
Guest
|
Posted:
Fri Dec 24, 2004 2:27 am Post subject:
Re: Is this a bug in ADO |
|
|
That's true!
If I find something, I'll post it here.
Regard
Rudy Steyaert
"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message
news:uUXt$dH6EHA.2032@tk2msftngp13.phx.gbl...
| Quote: |
"Rudy Steyaert" <rudy_steyaert@hotmail.com> wrote in message
news:ej3iSQH6EHA.616@TK2MSFTNGP09.phx.gbl...
Hi Al
If what I see beneath is the way you see the script I orginally posted I
would not call it garbled, I know stronger words for this (though not in
English. Happily :O)
Well, no, I just wanted to show it does not work for other multi-valued
fields in AD either. The otherTelephones is just *another* example of
this
weird behaviour in VBScript on an ASP-page (just wanted to stress out
that
Exchange does not need to be involved).
The fact that it is consistent implies less of a problem to me than if it
were the problem only for one multi-valued attribute. Still, it would be
nice to hear of a reasonable explanation...
/Al
Rudy
"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message
news:eyqeD2E6EHA.3756@TK2MSFTNGP14.phx.gbl...
"Rudy Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:%234i05045EHA.3616@TK2MSFTNGP11.phx.gbl...
Hello Al
Still investigating, but none of the proposed syntaxes work, except
for
the
v=Rs.Fields("ProxyAddresses").value
s=v(0)
Here is some sample-code to read other telephone-entries for a contact
that
has a given e-mail address in the proxy-addresses list
You can try it for yourself.
Strange if you ask me !
script got a bit garbled in posting, so I won't try it. Are you saying
that
the above syntax works for fields other htan "ProxyAddresses"? If so,
then
I
agree it is strange. It will be interesting if someone can point out a
reason/cause for this other than it being a "bug".
/Al
Regards
Rudy Steyaert
%
If (ShowOtherTelephones("someemailt@domain.com")) Then
Response.Write ("Found")
Else
Response.Write ("Not found")
End If
Function ShowOtherTelephones(email)
Set Conn=Server.CreateObject("ADODB.Connection")
Set Com=Server.CreateObject("ADODB.Command")
Set Rs=Server.CreateObject("ADODB.Recordset")
Conn.Provider="ADsDSOObject"
Conn.Open "ADs Provider"
Com.ActiveConnection=Conn
Com.CommandText="<LDAP://DC=MYDOMAIN,DC=local>;(&(objectCategory=Contact)(Pr
oxyaddresses=smtp:"&email&"));otherTelephone;subtree" Set Rs =
Com.Execute
Found=not Rs.EOF If Found Then s=Rs.Fields("otherTelephone").value
response.write (s(0)) ' test=Rs.Fields("otherTelephone").value(0) '
uncomment to make the pagecrash ... for each x in
Rs.Fields("otherTelephone").value response.write (x)&"<BR>" next End
If
Rs.Close Conn.Close Set Rs=Nothing Set Com=Nothing Set Conn=Nothing
ShowOtherTelephones=FoundEnd Function%>"Al Dunbar [MS-MVP]"
alan-no-drub-spam@hotmail.com> wrote in
messagenews:u4SAcVx5EHA.1564@TK2MSFTNGP09.phx.gbl...>> "Al Dunbar
[MS-MVP]"
alan-no-drub-spam@hotmail.com> wrote in message
news:%23Kw7ppw5EHA.4072@TK2MSFTNGP10.phx.gbl...>>>> "Rudy Steyaert"
rudy_steyaert@hotmail.com> wrote in message
news:%23$nN2fu5EHA.3616@TK2MSFTNGP11.phx.gbl...>> <snip>>>> Here are a
couple of things you could try (just for the heck of it):
s=Rs.Fields("ProxyAddresses").value((0))>>>> with
Rs.Fields("ProxyAddresses").value>> s = .(0)>> end with
v=Rs.Fields("ProxyAddresses").value>> s=v(0)>> Also:
s=Rs.Fields("ProxyAddresses")(0)>>>> Please post back the results if
you
try
this...>>>> /Al not here>>>> > "Ray Costanzo [MVP]" <my first name at
lane
34 dot commercial> wrote in>> > message
news:utBdbPs5EHA.2608@TK2MSFTNGP10.phx.gbl...>> > > Are you sure you
don't
have a Split() in there somewhere orsomething?>> I>> > > can't imagine
how
the first snippet would work.>> > >>> > > Ray at work>> > >>> > > "Rudy
Steyaert" <Rudy_Steyaert@hotmail.com> wrote in message
news:Or0m4Ls5EHA.2540@TK2MSFTNGP09.phx.gbl...>> > >> After a ADO call
this
works>> > >>>> > >> v=Rs.Fields("ProxyAddresses").value
s=v(0)
and this gives an error
s=Rs.Fields("ProxyAddresses").value(0)>> > >>>> > >> Microsoft VBScript
runtime error '800a01c2'>> > >> Wrong number of arguments or invalid
property assignment:>> > >> 'Rs.Fields(...).value'>> > >>>> > >> Can
anyone
help with this one please ?
|
|
|
| Back to top |
|
 |
|
|
|
|