Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Query length Limitations on Win2K Using "ADO" "Active Directory Provider" ... Error -2147217900

Reply
 
Old 06-01-2009   #1 (permalink)
just say NO to PDF


 
 

Query length Limitations on Win2K Using "ADO" "Active Directory Provider" ... Error -2147217900

Hi all,
I usually try to access my A/D using LDAP. However I thought hat I would
give it a try using ADO in my HTA (VBScript) application...

I seem to have run in to a limitation of the query length in my SELECT
statement.
I won't drive you nuts by posting my code, but suffice to say I have
isolated it to the following:

1) With ADODB/ADsDSOObject /Active Directory Provider, you can't do a
"SELECT * FROM ..."
This produces the error "Item cannot be found in the collection..."
I have tried this many ways, with/without quotes, etc. It seems to insist on
a list of column names!
Please tell me if I am wrong, this would solve the problem.

2) I can give it a long list of column names; it works fine on XP. However
on W2K it croaks with the above error -2147217900.
Maybe there is a DLL we can update to fix this problem? W2K support is a
must-have...the client systems are at the latest update level.

Many Thanks In Advance for any insights



My System SpecsSystem Spec
Old 06-01-2009   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: Query length Limitations on Win2K Using "ADO" "Active Directory Provider" ... Error -2147217900


"just say NO to PDF" <stingray_67@xxxxxx_spam.hotmail.com> wrote in message
news:uLM76wt4JHA.2656@xxxxxx
Quote:

> Hi all,
> I usually try to access my A/D using LDAP. However I thought hat I would
> give it a try using ADO in my HTA (VBScript) application...
>
> I seem to have run in to a limitation of the query length in my SELECT
> statement.
> I won't drive you nuts by posting my code, but suffice to say I have
> isolated it to the following:
>
> 1) With ADODB/ADsDSOObject /Active Directory Provider, you can't do a
> "SELECT * FROM ..."
> This produces the error "Item cannot be found in the collection..."
> I have tried this many ways, with/without quotes, etc. It seems to insist
> on a list of column names!
> Please tell me if I am wrong, this would solve the problem.
Using SQL syntax the only attribute returned when you use "SELECT *" is the
ADsPath. Using LDAP syntax you must specify the attributes by LDAP display
name.
Quote:

>
> 2) I can give it a long list of column names; it works fine on XP. However
> on W2K it croaks with the above error -2147217900.
> Maybe there is a DLL we can update to fix this problem? W2K support is a
> must-have...the client systems are at the latest update level.
>
> Many Thanks In Advance for any insights
I've never encountered an error due to the query string being too long, and
I've used some long queries. Was there an error description? If you have a
query that works on XP but not W2k, the difference must be the version of
MDAC. I think the only fix would be to update MDAC. However, I would try
using LDAP syntax before giving up. See this link:

http://www.rlmueller.net/ADOSearchTips.htm

All SQL syntax queries are converted to LDAP syntax under the covers, since
that is the only syntax really supported by AD. I will try queries with long
lists of attribute names and report back if I seem to encounter a limit.
Also, unless you use special code, you should only retrieve single-values
string attributes. Many attributes have syntaxes that will raise errors if
you treat the return value as a string. Of course, this has nothing to do
with the client OS.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
"ViewEntireForest": "Active Directory operation failed on . Thesupplied credential for PowerShell
Vista not wotking with "My Computer" or "Control Panel", "Screen Saver" Vista General
Active Directory "Log on to" restriction and Vista RDP Vista General
Active "sync" should be renamed Active "Stinks" Vista General
WM5 Sync with Vista "Windows Calender", "Contacts", and "Mail" Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46