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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

issues with a variable being passed via querystring 2

Status
Not open for further replies.

specialist

Programmer
Sep 7, 2001
50
US
Greetings All-

Happy holidays! I'm running into a bit of an issue with a variable being passed via querystring to return results from a SQL db. I continue to get a :

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: "SELECT COUNT (*) CAS"]'

error when opening this page. Perhaps I am confused by the syntax, but for some reason it is not working properly.

The purpose of this page is to display the count and record details from a DB based on a query string value passed from a form on another page...the options are:

entries less than 30 days old
" " 60 days old
" " 90 days old

please help me if you know a possible solution. thank you in advance and happy holidays!

michael

code:

<%
'*** The following items redesignate the incoming variables for use on this page
dateCriteria = Request.Querystring("dC")
readBack = (Date - dateCriteria)

Dim qryCount
Dim qryCount_numRows

Set qryCount = Server.CreateObject("ADODB.Recordset")
qryCount.ActiveConnection = MM_STRING
qryCount.Source = "SELECT COUNT (*) Entry FROM dbo.tblInfo WHERE Initial_DTG < '" + readBack + "' AND Status = 1"
qryCount.CursorType = 0
qryCount.CursorLocation = 2
qryCount.LockType = 1
qryCount.Open()

qryCount_numRows = 0
%>
<%
Dim mainQuery
Dim mainQuery_numRows

Set mainQuery = Server.CreateObject("ADODB.Recordset")
mainQuery.ActiveConnection = MM_STRING
mainQuery.Source = "SELECT * FROM tblInfo WHERE Initial_DTG < '" + readBack + "' AND Status = 1 ORDER BY Initial_DTG ASC "
mainQuery.CursorType = 0
mainQuery.CursorLocation = 2
mainQuery.LockType = 1
mainQuery.Open()

mainQuery_numRows = 0
%>
<%
Function showBreaks(str)
showBreaks = replace(str, chr(10), " <br>")
End Function

%>
 
Genimuse and Chopstik-

Everything is working perfectly now! Thank you both so much for your help, patience, and knowledge on the subject. I think it is safe to say this problem is resolved. I could not have done it with out your help! Muchas gracias!

- Michael :)
 
Glad to see you got it working! [thumbsup]

------------------------------------------------------------------------------------------------------------------------
If you don't have a sense of humor, you probably don't have any sense at all.
- Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top