Forum Moderators: open
Code snippet:
Set wRS = Server.CreateObject("ADODB.Recordset")
sql1="SELECT eID,COUNT(eID) AS count FROM TblX GROUP BY eID WHERE ID='"&ID&"'"
wRS.Open sql1,wCON,1,1,1
But it shows: Syntax error (missing operator) in query expression 'eID WHERE eID='115''.
I wonder what could be wrong. Any help is very much appreciated.
but the following error appeared:
"ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. "
When I used set wRS=wCON.Execute(sql1). No error appeared. But the recordCount gave -1. What I have done wrong?
but the following error appeared:
"ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. "
When I used set wRS=wCON.Execute(sql1). No error appeared. But the recordCount gave -1. What I have done wrong?
Then run it in T-SQL. If it runs fine, then remove all the optional parameters in your open statement. It's probably that last "1"
wRS.Open sql1,wCON
The .Open method accepts 5 Parameters. (Source, ActiveConnection, [CursorType], [LockType], [Options])
Your Open statement is passing 1 in the Options param. That's my bet.