Asked By
JesseJones
0 points
N/A
Posted on - 08/16/2011
Hello All,
I am posting this error message here so I can get help on this as soon as possible. Every now and then the SQL server connection to the Active Directory will crash.
I have SQL server installed on Windows server 2003. When I try to create a view in SQL with Active directory users I am getting this error message.
Any ideas why?
Â
SQL Server Enterprise Manager
[Microsoft][ODBC SQL Server Driver][SQL Server]An error occurred
while preparing a query for execution against OLEDB provider
‘ADSDSOObject’.
Â
An error occurred while preparing a query for execution against OLEDB provider
Â
Yes, there was this problem once getting renowned but now it is easy to fix. Try the following and you will be fine with it.Â
Add the 'MSDTC'Â to the registry. This must be done by adding the registry keys. If it is known, the no problems. If no, try the following:
In the key field, add  –  Key: [HKEY_LOCAL_MACHINESYSTEMCURRENTCONTROLSETSERVICESMSSQL]
Then in Value name, add  –  Value Name: DependOnService
After that, make value type to this one  –  Value Type : REG_MULTI_SZ
After that the value must be equal to MSDTC.
Cheers.
An error occurred while preparing a query for execution against OLEDB provider
Â
You can note that this error message refers to the query that contains incorrect syntax. This must have some unbalanced quotes. You can have it resolved using any of the following techniques,
·        You can use VBScript for such queries and can use single quote characters in your desired SQL statement within the string.
·        Do these steps,
o  Define the server linked (which has been used in SQL).
o  Search the LDAP names which you want to use in the query.
o  To get them, use the SELECT statement.