Help!
I've seen a few others with this problem, but have not found a
solution anywhere:
I'm trying to link AD/AM to SQL Server through ADSI for querying in
SQL.
Environment:
Windows Server 2003 **Not in an AD domain
SQL Server 2000 (running under 'administrator' user account)
ADAM (Added "servername\administrator" and several adam users to the
"Readers" role)
Steps taken:
1. Add Linked Server-
sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces',
'ADSDSOObject', 'adsdatasource'
2. Multiple Attempts at Linked Server Login-
exec sp_addlinkedsrvlogin 'ADSI', false, 'MACHINENAME\administrator',
'MACHINENAME\administrator', 'password'
exec sp_addlinkedsrvlogin 'ADSI', false, 'MACHINENAME\administrator',
'cn=username,cn=users,cn=app,dc=company,
dc=com', 'password'
3. Multiple Attempts to Query through SQL Query Analyzer-
SELECT * FROM OpenQuery(ADSI,
'<LDAP://localhost:389/cn=app,DC=company,DC=com>;subtree')
SELECT * FROM OpenQuery(ADSI,
'<LDAP://localhost:389/cn=app,DC=company,DC=com/cn=users>;subtree')
-- All of the above result in the following error message: OLE DB
provider 'ADSDSOObject' reported an error. The provider indicates that
the user did not have the permission to perform the operation.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
ICommandPrepare::Prepare returned 0x80040e09: The provider indicates
that the user did not have the permission to perform the operation.].
Now, this query did result in a different error message:
SELECT * FROM OpenQuery(ADAMConn, 'SELECT * FROM
''LDAP://localhost:389/ cn=app,DC=company,DC=com'' WHERE
objectCategory = ''Person''')
--Message: OLE/DB Provider 'ADSDSOObject' ICommandPrepare::Prepare
returned 0x80040e09: The provider indicates that the user did not
have the permission to perform the operation.
Can someone help'!!Having same issue...LOTS of people with problem...but no solution posted.
Showing posts with label helpi. Show all posts
Showing posts with label helpi. Show all posts
Thursday, March 8, 2012
Sunday, February 19, 2012
ADO Recordset time out during query..PLEASE HELP
PLEASE HELP!
I have a large query that takes about a minute to run from the SQL Query
Analyzer. Now when I run the query from VB6 it craps out 30 seconds into it.
Is there a way around this without manipulating my query. I'm attaching the
query maybe you'll see something I can adjust i'm not a SQL guy so my query
may come off as crude but it works.... sort of!
"SELECT Master.* , Projects.VolumeCode as Expr1 FROM Master
INNER JOIN projects ON Master.ProjectNumber = projects.ProjectNumber
WHERE (Master.TSRDate >= CONVERT(DATETIME, '2004-01-01 00:00:00', 102))AND
(Master.TSRDate < CONVERT(DATETIME, '" + NewDateString + "', 102))
AND (Master.TSRDate + Projects.HoldTime < CONVERT(DATETIME, '" +
NewDateString + "', 102)) AND (Master.ProjectNumber >10)
AND (Not (Master.ProjectNumber=5682))
AND (Not (Master.ProjectNumber=4520))
AND (Not (Master.ProjectNumber=5535))
AND (Not (Master.ProjectNumber=6042))
AND (Not (Master.ProjectNumber=5867))
AND (Master.VolumeID Is Null)
ORDER BY Master.recordnumber;"
Thanks
Rob
IT guy!
at very quick glance,
is there a nonclustered index on ProjectNumber column?
is there a clustered index on the recordnumber column?
you might need to check Index Tunning Wizard for suggestions of possible
indexes
"Rob" <Rob@.discussions.microsoft.com> wrote in message
news:C9D32D06-A9E8-450D-B53B-F45860A8D7C3@.microsoft.com...
> PLEASE HELP!
> I have a large query that takes about a minute to run from the SQL Query
> Analyzer. Now when I run the query from VB6 it craps out 30 seconds into
it.
> Is there a way around this without manipulating my query. I'm attaching
the
> query maybe you'll see something I can adjust i'm not a SQL guy so my
query
> may come off as crude but it works.... sort of!
> "SELECT Master.* , Projects.VolumeCode as Expr1 FROM Master
> INNER JOIN projects ON Master.ProjectNumber = projects.ProjectNumber
> WHERE (Master.TSRDate >= CONVERT(DATETIME, '2004-01-01 00:00:00', 102))AND
> (Master.TSRDate < CONVERT(DATETIME, '" + NewDateString + "', 102))
> AND (Master.TSRDate + Projects.HoldTime < CONVERT(DATETIME, '" +
> NewDateString + "', 102)) AND (Master.ProjectNumber >10)
> AND (Not (Master.ProjectNumber=5682))
> AND (Not (Master.ProjectNumber=4520))
> AND (Not (Master.ProjectNumber=5535))
> AND (Not (Master.ProjectNumber=6042))
> AND (Not (Master.ProjectNumber=5867))
> AND (Master.VolumeID Is Null)
> ORDER BY Master.recordnumber;"
> Thanks
> --
> Rob
> IT guy!
|||In addition to tuning the sql statement and making sure that you have
appropriate indexes in place, have you tried increasing the .CommandTimeout
(within your VB code)?
Keith
"Rob" <Rob@.discussions.microsoft.com> wrote in message
news:C9D32D06-A9E8-450D-B53B-F45860A8D7C3@.microsoft.com...
> PLEASE HELP!
> I have a large query that takes about a minute to run from the SQL Query
> Analyzer. Now when I run the query from VB6 it craps out 30 seconds into
it.
> Is there a way around this without manipulating my query. I'm attaching
the
> query maybe you'll see something I can adjust i'm not a SQL guy so my
query
> may come off as crude but it works.... sort of!
> "SELECT Master.* , Projects.VolumeCode as Expr1 FROM Master
> INNER JOIN projects ON Master.ProjectNumber = projects.ProjectNumber
> WHERE (Master.TSRDate >= CONVERT(DATETIME, '2004-01-01 00:00:00', 102))AND
> (Master.TSRDate < CONVERT(DATETIME, '" + NewDateString + "', 102))
> AND (Master.TSRDate + Projects.HoldTime < CONVERT(DATETIME, '" +
> NewDateString + "', 102)) AND (Master.ProjectNumber >10)
> AND (Not (Master.ProjectNumber=5682))
> AND (Not (Master.ProjectNumber=4520))
> AND (Not (Master.ProjectNumber=5535))
> AND (Not (Master.ProjectNumber=6042))
> AND (Not (Master.ProjectNumber=5867))
> AND (Master.VolumeID Is Null)
> ORDER BY Master.recordnumber;"
> Thanks
> --
> Rob
> IT guy!
I have a large query that takes about a minute to run from the SQL Query
Analyzer. Now when I run the query from VB6 it craps out 30 seconds into it.
Is there a way around this without manipulating my query. I'm attaching the
query maybe you'll see something I can adjust i'm not a SQL guy so my query
may come off as crude but it works.... sort of!

"SELECT Master.* , Projects.VolumeCode as Expr1 FROM Master
INNER JOIN projects ON Master.ProjectNumber = projects.ProjectNumber
WHERE (Master.TSRDate >= CONVERT(DATETIME, '2004-01-01 00:00:00', 102))AND
(Master.TSRDate < CONVERT(DATETIME, '" + NewDateString + "', 102))
AND (Master.TSRDate + Projects.HoldTime < CONVERT(DATETIME, '" +
NewDateString + "', 102)) AND (Master.ProjectNumber >10)
AND (Not (Master.ProjectNumber=5682))
AND (Not (Master.ProjectNumber=4520))
AND (Not (Master.ProjectNumber=5535))
AND (Not (Master.ProjectNumber=6042))
AND (Not (Master.ProjectNumber=5867))
AND (Master.VolumeID Is Null)
ORDER BY Master.recordnumber;"
Thanks
Rob
IT guy!
at very quick glance,
is there a nonclustered index on ProjectNumber column?
is there a clustered index on the recordnumber column?
you might need to check Index Tunning Wizard for suggestions of possible
indexes
"Rob" <Rob@.discussions.microsoft.com> wrote in message
news:C9D32D06-A9E8-450D-B53B-F45860A8D7C3@.microsoft.com...
> PLEASE HELP!
> I have a large query that takes about a minute to run from the SQL Query
> Analyzer. Now when I run the query from VB6 it craps out 30 seconds into
it.
> Is there a way around this without manipulating my query. I'm attaching
the
> query maybe you'll see something I can adjust i'm not a SQL guy so my
query
> may come off as crude but it works.... sort of!

> "SELECT Master.* , Projects.VolumeCode as Expr1 FROM Master
> INNER JOIN projects ON Master.ProjectNumber = projects.ProjectNumber
> WHERE (Master.TSRDate >= CONVERT(DATETIME, '2004-01-01 00:00:00', 102))AND
> (Master.TSRDate < CONVERT(DATETIME, '" + NewDateString + "', 102))
> AND (Master.TSRDate + Projects.HoldTime < CONVERT(DATETIME, '" +
> NewDateString + "', 102)) AND (Master.ProjectNumber >10)
> AND (Not (Master.ProjectNumber=5682))
> AND (Not (Master.ProjectNumber=4520))
> AND (Not (Master.ProjectNumber=5535))
> AND (Not (Master.ProjectNumber=6042))
> AND (Not (Master.ProjectNumber=5867))
> AND (Master.VolumeID Is Null)
> ORDER BY Master.recordnumber;"
> Thanks
> --
> Rob
> IT guy!
|||In addition to tuning the sql statement and making sure that you have
appropriate indexes in place, have you tried increasing the .CommandTimeout
(within your VB code)?
Keith
"Rob" <Rob@.discussions.microsoft.com> wrote in message
news:C9D32D06-A9E8-450D-B53B-F45860A8D7C3@.microsoft.com...
> PLEASE HELP!
> I have a large query that takes about a minute to run from the SQL Query
> Analyzer. Now when I run the query from VB6 it craps out 30 seconds into
it.
> Is there a way around this without manipulating my query. I'm attaching
the
> query maybe you'll see something I can adjust i'm not a SQL guy so my
query
> may come off as crude but it works.... sort of!

> "SELECT Master.* , Projects.VolumeCode as Expr1 FROM Master
> INNER JOIN projects ON Master.ProjectNumber = projects.ProjectNumber
> WHERE (Master.TSRDate >= CONVERT(DATETIME, '2004-01-01 00:00:00', 102))AND
> (Master.TSRDate < CONVERT(DATETIME, '" + NewDateString + "', 102))
> AND (Master.TSRDate + Projects.HoldTime < CONVERT(DATETIME, '" +
> NewDateString + "', 102)) AND (Master.ProjectNumber >10)
> AND (Not (Master.ProjectNumber=5682))
> AND (Not (Master.ProjectNumber=4520))
> AND (Not (Master.ProjectNumber=5535))
> AND (Not (Master.ProjectNumber=6042))
> AND (Not (Master.ProjectNumber=5867))
> AND (Master.VolumeID Is Null)
> ORDER BY Master.recordnumber;"
> Thanks
> --
> Rob
> IT guy!
Subscribe to:
Posts (Atom)