Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strang error occurred

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
Dear ALL:
I met a problem when I ran my ASP code. When I ran this query code,
strSQLSummary = "SELECT Count(Prococedure) AS NOProcedure, category "
strSQLSummary = strSQLSummary & "FROM FORM_ID_198163500 WHERE BaylorID= """ & strSelectedName & """" & " AND category = """ & strSelectedCategory & """" & " GROUP BY category;"

there is no error. But when this query was include in if-endif clause, it gave me an error.

if Request.Form(&quot;startDate&quot;) <> &quot;&quot; AND Request.form(&quot;endDate&quot;) <> &quot;&quot; then
strSQLSummary = &quot;SELECT Count(Prococedure) AS NOProcedure, category &quot;
strSQLSummary = strSQLSummary & &quot;FROM FORM_ID_198163500 WHERE BaylorID= &quot;&quot;&quot; & strSelectedName & &quot;&quot;&quot;&quot; & &quot; AND category = &quot;&quot;&quot; & strSelectedCategory & &quot;&quot;&quot;&quot; & &quot; GROUP BY category;&quot;
end if

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/haijunw/summaryByresident.asp, line 4

What is the reason for that?

Thanks

Haijun
 
This part of your query
... category &quot; strSQLSummary = strSQLSummary & &quot;FROM ...
looks weird.

You can't have an &quot;=&quot; before the FROM.

 
The best way to solve this kind of SQL problems, dumping the clause to the screen just before you execute.

response.write strSQLSummary

You'll see probably some parameters are probably missing/mistyped for some reason.
 
hey u have not declared connection object to open your recordset

prasad
sawantprasad2001@yahoo.com
 
Thank you for all your responses. My query code has no problem, when I ran it. The error occurred when I added if-endif.

Prococedure is valid variable, even though the spelling is not right.

The conn object was declared in my ASP page.

Thanks


 
I just saw something - I'm not sure if the double quotes work with SQL did you try single quotes?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top