473,609 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RS EOF question

I have some simple code see below.

I have response written out the query and it is valid and returns values
when ran directly against my db, which is Oracle. My OS is Win 2003.

My question is I never get to the point of the loop. It always thinks I am
at the RS.EOF. Similar code works in other asp pages on the same server.
How do I debug this or am I missing something obvious??

Thanks
Mike


CODE

Set Conn = Server.CreateOb ject("ADODB.Con nection")

Conn.Open strConnectStrin g
Set RS = Conn.Execute(SQ L)

If RS.Eof then
Response.write "<center><b >"
response.write "There are no values in the system that match your query."
Response.write "<br>Please Try Again!"
response.write "</b><form>"
response.write "<input type='button' value='Retry' onclick=history .back()>"
response.write "</form></center>"
response.end

Else
Do While Not RS.EOF
<stuff>

RS.MoveNext
Loop
End If

Set RS = Nothing
Conn.Close : Set Conn = Nothing
Jan 5 '06 #1
9 5693
I cant see anything wrong although I always use
Do until rs.eof

I cant see hat being the difference.

I suspect that it is your SQL string you did no post


"Mike" <Mi**@discussio ns.microsoft.co m> wrote in message
news:86******** *************** ***********@mic rosoft.com...
I have some simple code see below.

I have response written out the query and it is valid and returns values
when ran directly against my db, which is Oracle. My OS is Win 2003.

My question is I never get to the point of the loop. It always thinks I
am
at the RS.EOF. Similar code works in other asp pages on the same server.
How do I debug this or am I missing something obvious??

Thanks
Mike


CODE

Set Conn = Server.CreateOb ject("ADODB.Con nection")

Conn.Open strConnectStrin g
Set RS = Conn.Execute(SQ L)

If RS.Eof then
Response.write "<center><b >"
response.write "There are no values in the system that match your query."
Response.write "<br>Please Try Again!"
response.write "</b><form>"
response.write "<input type='button' value='Retry'
onclick=history .back()>"
response.write "</form></center>"
response.end

Else
Do While Not RS.EOF
<stuff>

RS.MoveNext
Loop
End If

Set RS = Nothing
Conn.Close : Set Conn = Nothing

Jan 5 '06 #2
The result of this code:

Set RS = Conn.Execute(SQ L)

response.write rs.bof & " rs.bof <br>"
response.write rs.eof & " rs.eof <br>"

is
True rs.bof
True rs.eof
"Mike" wrote:
I have some simple code see below.

I have response written out the query and it is valid and returns values
when ran directly against my db, which is Oracle. My OS is Win 2003.

My question is I never get to the point of the loop. It always thinks I am
at the RS.EOF. Similar code works in other asp pages on the same server.
How do I debug this or am I missing something obvious??

Thanks
Mike


CODE

Set Conn = Server.CreateOb ject("ADODB.Con nection")

Conn.Open strConnectStrin g
Set RS = Conn.Execute(SQ L)

If RS.Eof then
Response.write "<center><b >"
response.write "There are no values in the system that match your query."
Response.write "<br>Please Try Again!"
response.write "</b><form>"
response.write "<input type='button' value='Retry' onclick=history .back()>"
response.write "</form></center>"
response.end

Else
Do While Not RS.EOF
<stuff>

RS.MoveNext
Loop
End If

Set RS = Nothing
Conn.Close : Set Conn = Nothing

Jan 5 '06 #3
Mike wrote:
The result of this code:

Set RS = Conn.Execute(SQ L)

response.write rs.bof & " rs.bof <br>"
response.write rs.eof & " rs.eof <br>"

is
True rs.bof
True rs.eof


This obviously means that your query is not returning any records. To debug
it (assuming you are using <ugh!!> dynamic sql) you need to

Response.Write SQL
Response.End

run the page and look at the statement in the browser window. If you've
created it correctly, you should be able to copy it to the clipboard from
the browser window and paste it into the query execution tool for whatever
database you are using and test it.

Bob Barrows
--
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.
Jan 5 '06 #4
> response.write rs.bof & " rs.bof <br>"
response.write rs.eof & " rs.eof <br>"

is
True rs.bof
True rs.eof


That tells me that your SQL statement is returning ZERO rows.

Brian

Jan 5 '06 #5
Looks good. You could copy/paste the SQL string to make sure you running the
same query. Try also to use the full name for the object or a simple
COUNT(*) request. I suspect that you don't query against the same data...
--
Patrice

"Mike" <Mi**@discussio ns.microsoft.co m> a écrit dans le message de
news:86******** *************** ***********@mic rosoft.com...
I have some simple code see below.

I have response written out the query and it is valid and returns values
when ran directly against my db, which is Oracle. My OS is Win 2003.

My question is I never get to the point of the loop. It always thinks I am at the RS.EOF. Similar code works in other asp pages on the same server.
How do I debug this or am I missing something obvious??

Thanks
Mike


CODE

Set Conn = Server.CreateOb ject("ADODB.Con nection")

Conn.Open strConnectStrin g
Set RS = Conn.Execute(SQ L)

If RS.Eof then
Response.write "<center><b >"
response.write "There are no values in the system that match your query."
Response.write "<br>Please Try Again!"
response.write "</b><form>"
response.write "<input type='button' value='Retry' onclick=history .back()>" response.write "</form></center>"
response.end

Else
Do While Not RS.EOF
<stuff>

RS.MoveNext
Loop
End If

Set RS = Nothing
Conn.Close : Set Conn = Nothing

Jan 5 '06 #6
As I said in my initial post I did response.write it out and paste it in Toad
and ran a query against me oracle db and it returns values.

Here is the query and no I am not using * but I used it for a test and it
too does not return records. If I use a query Select * from
Activity_tracki ng it returns records.

I just did a test of my query and if I remove the "AND AT_DATE between
'1-Jan-2005' AND '1-Jan-2007'" it returns values. There is something in the
between portion that is causing this??

Mike
Query
Select * from Activity_tracki ng, activities_ICD, Clients, Projects,
Contracts, methods, curve_definitio ns, components, runs, ru_cos where
rc_cd_key = cd_key AND pr_cn_key = cn_key AND cn_cl_key = cl_key AND
pr_me_key = me_key AND pr_key = cd_pr_key AND cd_co_key = co_key AND pr_key =
ru_pr_key AND ru_key = rc_ru_key AND AT_RC_RUN_ID = rc_key AND pr_key =
AT_PR_key AND AI_AT_key = AT_key AND AT_DATE between '1-Jan-2005' AND
'1-Jan-2007'

"Bob Barrows [MVP]" wrote:
Mike wrote:
The result of this code:

Set RS = Conn.Execute(SQ L)

response.write rs.bof & " rs.bof <br>"
response.write rs.eof & " rs.eof <br>"

is
True rs.bof
True rs.eof


This obviously means that your query is not returning any records. To debug
it (assuming you are using <ugh!!> dynamic sql) you need to

Response.Write SQL
Response.End

run the page and look at the statement in the browser window. If you've
created it correctly, you should be able to copy it to the clipboard from
the browser window and paste it into the query execution tool for whatever
database you are using and test it.

Bob Barrows
--
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.

Jan 5 '06 #7
It's interesting at least to me if I change the date format so that my query
uses
AND AT_DATE between '2005-Jan-1' AND '2007-Jan-1' it works from asp but not
from my Toad client. I wish I was still using MS SQL 2000

Mike

"Mike" wrote:
As I said in my initial post I did response.write it out and paste it in Toad
and ran a query against me oracle db and it returns values.

Here is the query and no I am not using * but I used it for a test and it
too does not return records. If I use a query Select * from
Activity_tracki ng it returns records.

I just did a test of my query and if I remove the "AND AT_DATE between
'1-Jan-2005' AND '1-Jan-2007'" it returns values. There is something in the
between portion that is causing this??

Mike
Query
Select * from Activity_tracki ng, activities_ICD, Clients, Projects,
Contracts, methods, curve_definitio ns, components, runs, ru_cos where
rc_cd_key = cd_key AND pr_cn_key = cn_key AND cn_cl_key = cl_key AND
pr_me_key = me_key AND pr_key = cd_pr_key AND cd_co_key = co_key AND pr_key =
ru_pr_key AND ru_key = rc_ru_key AND AT_RC_RUN_ID = rc_key AND pr_key =
AT_PR_key AND AI_AT_key = AT_key AND AT_DATE between '1-Jan-2005' AND
'1-Jan-2007'

"Bob Barrows [MVP]" wrote:
Mike wrote:
The result of this code:

Set RS = Conn.Execute(SQ L)

response.write rs.bof & " rs.bof <br>"
response.write rs.eof & " rs.eof <br>"

is
True rs.bof
True rs.eof


This obviously means that your query is not returning any records. To debug
it (assuming you are using <ugh!!> dynamic sql) you need to

Response.Write SQL
Response.End

run the page and look at the statement in the browser window. If you've
created it correctly, you should be able to copy it to the clipboard from
the browser window and paste it into the query execution tool for whatever
database you are using and test it.

Bob Barrows
--
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.

Jan 5 '06 #8
Mike wrote:
As I said in my initial post I did response.write it out and paste it
in Toad and ran a query against me oracle db and it returns values.
Oh, sorry, i missed that.
Here is the query and no I am not using * but I used it for a test
and it too does not return records. If I use a query Select * from
Activity_tracki ng it returns records.

I just did a test of my query and if I remove the "AND AT_DATE between
'1-Jan-2005' AND '1-Jan-2007'" it returns values. There is something
in the between portion that is causing this??


I'm not familiar with Oracle, but i suspect the date format is causing a
problem. You should try using the ISO date format (yyyymmdd or yyyy-mm-dd)
and see if it makes a difference. The OLE DB provider you are using may be
misinterpreting the dates.
--
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.
Jan 5 '06 #9
The date format was the issue. From asp it takes one format and from Toad(my
oracle client) it takes a different format. That's why it was difficult to
debug.

Thanks to all

Mike

"Bob Barrows [MVP]" wrote:
Mike wrote:
As I said in my initial post I did response.write it out and paste it
in Toad and ran a query against me oracle db and it returns values.


Oh, sorry, i missed that.

Here is the query and no I am not using * but I used it for a test
and it too does not return records. If I use a query Select * from
Activity_tracki ng it returns records.

I just did a test of my query and if I remove the "AND AT_DATE between
'1-Jan-2005' AND '1-Jan-2007'" it returns values. There is something
in the between portion that is causing this??


I'm not familiar with Oracle, but i suspect the date format is causing a
problem. You should try using the ISO date format (yyyymmdd or yyyy-mm-dd)
and see if it makes a difference. The OLE DB provider you are using may be
misinterpreting the dates.
--
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.

Jan 5 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3095
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
5027
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
2652
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask it differently. FOUR QUESTIONS: The background: I got three (3) files
3
3075
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
10
3417
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
10
3706
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server Error in '/QuickStartv20' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file
53
4050
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
4748
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
4269
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from less to more for example). I have a question object that has two properties that contain the collections Options and Ratings. now I want this kind of layout: --- Rating1 Rating2 Rating3 Option 1 () () ...
3
2545
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div class="not-required-question"><p>Question Text</p><input /></div>
0
8133
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8573
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8547
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8224
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7013
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5517
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4026
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2535
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1676
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.