Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 09:13:06 -0400
simba wrote:
Hi Bob,
here is my new modified code as you suggested:
<%
QUERY = "SELECT Count(*) FROM " & TABLESLIDE & " WHERE ZONEID = '" &
Careful, this is not what I suggested. The Count(*) bit was for rs, not
for TextPageNumRS. My suggestion was for you to use:
QUERY = "SELECT Num FROM ...
ZonesRS("ID") & "' AND DATE_START < " & Date2SQL(Now) & " AND<snip>
DATE_STOP > " & Date2SQL(Now) & " ORDER BY NUM"
Set TextPageNumRS = ObjConnection.Execute(QUERY,,1)
If Not TextPageNumRS.EOF Then
arData = TextPageNumRS.GetRows()
End If
TextPageNumRS.Close
Set TextPageNumRS=nothing
If isArray(arData) Then
isArray(arData) always come up as False though there are 5 rows.1. Verify that your query string contains the query you expect it to
Any suggestions.
contain:
response.write "QUERY contains """ & QUERY & """<BR>"
2. Copy the sql statement resulting from this response.write from thhe
browser window into the native query execution tool used for whatever
database you are using and verify that it returns the correct results
using that tool.
PS. instead of concatenating the result of the vbscript Now function
into your sql statement, you should use the date/time function provided
by whatever database you are using. For example, if you are using Jet
(Access), you should change your sql statement to:
QUERY = "SELECT Num FROM " & TABLESLIDE & _
" WHERE ZONEID = '" & ZonesRS("ID") & "' " & _
"AND DATE_START < Now AND " & _
"DATE_STOP > Now ORDER BY NUM"
response.write "QUERY contains """ & QUERY & """<BR>"
If using SQL Server, use the GETDATE() function instead of Now.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- References:
- Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- From: Bob Barrows [MVP]
- Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- From: simba
- Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- Prev by Date: Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- Next by Date: Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- Previous by thread: Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- Next by thread: Re: WHILE LOOP NOT WORKING IN INCLUDE ASP FILE - LOOPING FOREVER
- Index(es):
Relevant Pages
|
|