473,320 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

last record doesn't display

http://www.middletree.net/debug/Disp...leTickets.html

Doing an Intranet-based app in ASP. I put the view source version (that is,
no ASP code) out on my personal site at the above URL to show you what I am
looking at. Style sheet isn't there, but shouldn't matter in this case.

My code says to show some things from the recordset based on certain
criteria selected from the search page. In this scase, the search page is
actually this same page, and you just click the checkbox to show or hide it.
It's a loop, and this page shows everything just fine, except once it gets
to a certain point, it won't show any more. In other words, you can scroll
down and see the info on Ticket number 15129, but then it doesn't show other
records which came up in the query, and should be displayed. It's like it
just gave up.

But what's wierd is that the other records, the ones now being displayed,
are in the source code.

I have a link at the top which allows you to get my actual ASP code. It's
zipped. One ASP file is an include inside the other one.

I imagine I have something wrong in my loop, but I have been looking at this
all day and can't find anything. Any help would be appreciated.
Jul 19 '05 #1
6 2283
I see do while not rs.eof but no rs.movenext / loop.

My code says to show some things from the recordset based on certain
criteria selected from the search page. In this scase, the search page is
actually this same page, and you just click the checkbox to show or hide it. It's a loop, and this page shows everything just fine, except once it gets
to a certain point, it won't show any more. In other words, you can scroll down and see the info on Ticket number 15129, but then it doesn't show other records which came up in the query, and should be displayed. It's like it
just gave up.

But what's wierd is that the other records, the ones now being displayed,
are in the source code.

I have a link at the top which allows you to get my actual ASP code. It's
zipped. One ASP file is an include inside the other one.

I imagine I have something wrong in my loop, but I have been looking at this all day and can't find anything. Any help would be appreciated.

Jul 19 '05 #2
A few suggestions.

(1) why are you using "strFullTIMESTMP" as a primary key? You realize it's
possible, due to the precision of datetime data types, to have multiple

(2) why are you using a bunch of nested recordsets to achieve what a single
inner join should be able to do?

(3) why do you constantly set rs = createobject("ADODB.Recordset") but never
destroy any of them?

(4) why are you allowing values from request.querystring into your SQL
statements unchecked? Have you tried something like...

DisplaySortableTickets.asp?strStatus=a';DELETE%20T KT_STATUS;SELECT%20'b

?

(5) why are you using ADODB.Recordset at all? These all seem to be
forward-only, static recordsets. Also, what's with SELECT * to retrieve one
column?

Here is a rewrite of the first portion. I'm still trying to figure out what
all your joins are doing in the bottom portion, and then why you need to go
out multiple more times to the same tables...
<!-- #INCLUDE FILE="includes/functions.asp" -->
<!-- #INCLUDE FILE="includes/argodbinc.asp" -->
<!-- #INCLUDE FILE="includes/colors.inc" -->

<%
function fixVal(s)
s = replace(request.QueryString(s), "'", "''"))
end function

strSort = fixVal("Sort")
strDate1 = fixVal("Date1")
strDate2 = fixVal("Date2")
strTSE = fixVal("selectTSE")
strStatus = fixVal("Status")
strCustomerCode = fixVal("CustomerCode")

If strSort = "" then
strSort = "Orig_TimeStamp"
strSortName = "Original Open Date"
Else
strSortName = "Customer"
If strSort = "AssignedEmployee" then strSortName = "Assigned Employee"
End if

If strStatus = "" then
strStatusName = "Open"
Else
strSQL = "SELECT Description FROM TKT_Status" & _
" WHERE StatusID = '" & strStatus & "'"
set rs = objConnection.Execute(strSQL)
strStatusName = rs("Description")
RS.close: set rs = nothing
End if

If strTSE = "" then
strTSEName = ""
Else
strSQL = "SELECT FirstName + LastName AS TSEName FROM Employee "
strSQL = strSQL & "WHERE EmployeeID = '" & strTSE & "'"
set rs = objConnection.Execute(strSQL)
strTSEName = rs("TSEName")
RS.close: set rs = nothing
End if

If strCustomerCode = "" then
strCustomerName = ""
Else
strSQL = "SELECT CustomerName FROM Customer "
strSQL = strSQL & "WHERE CustomerCode = '" & strCustomerCode & "'"
set rs = objConnection.Execute(strSQL)
strCustomerName = rs("CustomerName")
RS.close: set rs = nothing
End if
%>
"middletree" <mi********@htomail.com> wrote in message
news:e3**************@TK2MSFTNGP12.phx.gbl...
http://www.middletree.net/debug/Disp...leTickets.html

Doing an Intranet-based app in ASP. I put the view source version (that is, no ASP code) out on my personal site at the above URL to show you what I am looking at. Style sheet isn't there, but shouldn't matter in this case.

My code says to show some things from the recordset based on certain
criteria selected from the search page. In this scase, the search page is
actually this same page, and you just click the checkbox to show or hide it. It's a loop, and this page shows everything just fine, except once it gets
to a certain point, it won't show any more. In other words, you can scroll down and see the info on Ticket number 15129, but then it doesn't show other records which came up in the query, and should be displayed. It's like it
just gave up.

But what's wierd is that the other records, the ones now being displayed,
are in the source code.

I have a link at the top which allows you to get my actual ASP code. It's
zipped. One ASP file is an include inside the other one.

I imagine I have something wrong in my loop, but I have been looking at this all day and can't find anything. Any help would be appreciated.

Jul 19 '05 #3
Sorry, a couple of clarifications:
(1) why are you using "strFullTIMESTMP" as a primary key? You realize it's possible, due to the precision of datetime data types, to have multiple

identical values in the same table?

function fixVal(s)
fixVal = replace(request.QueryString(s), "'", "''"))
end function
Jul 19 '05 #4
Good questions. The short answer is that I have a lot to learn. As for the
multiple queries when a more complex single query with Joins, well, I just
built this thing piece by piece, no real planning, didn't intend anyone but
me to use it, then the boss heard about it and I started doing things to
make him happy and put the thing on the Intranet for all employees to use.

I will look into all your suggestions and see what I can do. Thing is, this
is a side project, my customers take up most of my time (I work in a
Customer Care group at my company), so most of the improvement I can do to
this app is during lunch or at home (thankfully, my work machine is a
laptop).

I agree with you that if this were planned out and designed appropriately,
it would be much improved.

For the record, I don't use the timestamp field as my primary key. Can you
point me to which line of code you are referring to?

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:Oh**************@TK2MSFTNGP12.phx.gbl...
A few suggestions.

(1) why are you using "strFullTIMESTMP" as a primary key? You realize it's possible, due to the precision of datetime data types, to have multiple

(2) why are you using a bunch of nested recordsets to achieve what a single inner join should be able to do?

(3) why do you constantly set rs = createobject("ADODB.Recordset") but never destroy any of them?

(4) why are you allowing values from request.querystring into your SQL
statements unchecked? Have you tried something like...

DisplaySortableTickets.asp?strStatus=a';DELETE%20T KT_STATUS;SELECT%20'b

?

(5) why are you using ADODB.Recordset at all? These all seem to be
forward-only, static recordsets. Also, what's with SELECT * to retrieve one column?

Here is a rewrite of the first portion. I'm still trying to figure out what all your joins are doing in the bottom portion, and then why you need to go out multiple more times to the same tables...
<!-- #INCLUDE FILE="includes/functions.asp" -->
<!-- #INCLUDE FILE="includes/argodbinc.asp" -->
<!-- #INCLUDE FILE="includes/colors.inc" -->

<%
function fixVal(s)
s = replace(request.QueryString(s), "'", "''"))
end function

strSort = fixVal("Sort")
strDate1 = fixVal("Date1")
strDate2 = fixVal("Date2")
strTSE = fixVal("selectTSE")
strStatus = fixVal("Status")
strCustomerCode = fixVal("CustomerCode")

If strSort = "" then
strSort = "Orig_TimeStamp"
strSortName = "Original Open Date"
Else
strSortName = "Customer"
If strSort = "AssignedEmployee" then strSortName = "Assigned Employee"
End if

If strStatus = "" then
strStatusName = "Open"
Else
strSQL = "SELECT Description FROM TKT_Status" & _
" WHERE StatusID = '" & strStatus & "'"
set rs = objConnection.Execute(strSQL)
strStatusName = rs("Description")
RS.close: set rs = nothing
End if

If strTSE = "" then
strTSEName = ""
Else
strSQL = "SELECT FirstName + LastName AS TSEName FROM Employee "
strSQL = strSQL & "WHERE EmployeeID = '" & strTSE & "'"
set rs = objConnection.Execute(strSQL)
strTSEName = rs("TSEName")
RS.close: set rs = nothing
End if

If strCustomerCode = "" then
strCustomerName = ""
Else
strSQL = "SELECT CustomerName FROM Customer "
strSQL = strSQL & "WHERE CustomerCode = '" & strCustomerCode & "'"
set rs = objConnection.Execute(strSQL)
strCustomerName = rs("CustomerName")
RS.close: set rs = nothing
End if
%>
"middletree" <mi********@htomail.com> wrote in message
news:e3**************@TK2MSFTNGP12.phx.gbl...
http://www.middletree.net/debug/Disp...leTickets.html

Doing an Intranet-based app in ASP. I put the view source version (that

is,
no ASP code) out on my personal site at the above URL to show you what I

am
looking at. Style sheet isn't there, but shouldn't matter in this case.

My code says to show some things from the recordset based on certain
criteria selected from the search page. In this scase, the search page is actually this same page, and you just click the checkbox to show or hide

it.
It's a loop, and this page shows everything just fine, except once it gets to a certain point, it won't show any more. In other words, you can

scroll
down and see the info on Ticket number 15129, but then it doesn't show

other
records which came up in the query, and should be displayed. It's like it just gave up.

But what's wierd is that the other records, the ones now being displayed, are in the source code.

I have a link at the top which allows you to get my actual ASP code. It's zipped. One ASP file is an include inside the other one.

I imagine I have something wrong in my loop, but I have been looking at

this
all day and can't find anything. Any help would be appreciated.


Jul 19 '05 #5
> For the record, I don't use the timestamp field as my primary key. Can you
point me to which line of code you are referring to?


I didn't mean to say you were using is as your primary key, but you are
definitely treating it like one. The following query may return multiple,
or the wrong row(s), yet your code assumes it could only return exactly one
row:

strSQL = "SELECT InternalDesc FROM TKT_History " & _
"WHERE TIMESTMP = '" & strFullTIMESTMP &"'"

(line 549-550, in my editor)
Jul 19 '05 #6
You are correct; I need to change that. It's extremely unlikely, since only
8 people use this app, that two entries will be made at exactly the same
time, but why take the chance?

BTW, last Friday, I had a Replace issue that you were helping me on. Just
thought I'd let you know that I didn't kow that the replace function is
case-sensitive. That little revelation allowed me to make the replace thing
work.

thanks,

James W
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl...
For the record, I don't use the timestamp field as my primary key. Can you point me to which line of code you are referring to?
I didn't mean to say you were using is as your primary key, but you are
definitely treating it like one. The following query may return multiple,
or the wrong row(s), yet your code assumes it could only return exactly

one row:

strSQL = "SELECT InternalDesc FROM TKT_History " & _
"WHERE TIMESTMP = '" & strFullTIMESTMP &"'"

(line 549-550, in my editor)

Jul 19 '05 #7

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

Similar topics

8
by: Dan Matthews | last post by:
Hey everybody, I have an 2000 Access database that stores job listings from potential employers for a school. I would like to be able to display the date on a webpage the last time the database...
9
by: Paola | last post by:
I'm a new to asp and I'm trying to display the entired last row on the DB. I try the objRecordset.MoveLast but I get the erros saying "Rowset does not support fetching backward." How I can do that?...
10
by: Alain Guichaoua | last post by:
Good evening to all Here is my problem : I have a form with a subform. They are linked. When I open the form I would like the subform to reach its last record. I tried the method...
4
by: deko | last post by:
I can't move a multi-page report to the last record unless I keep the popup form (that defined it's subreports) open. DoCmd.OpenReport "rptStandard", acViewNormal DoCmd.Close acForm,...
1
by: BLUE WATER | last post by:
Does anyone know how I can see a value in my form field text box ? I tried to add a text box, but the record source doesn't list the variable I want to see for each record. The variable is the...
4
by: Rico | last post by:
Hi All, Just wondering, in vb code, how to if the last record on a cascading form is the current record? Thanks!
1
by: lorirobn | last post by:
Hi, I have a report that has a query as its record source. The query picks up records from a table that meet certain criterion. The report then counts how many records there are for each key...
2
by: sheenaa | last post by:
Hi, I want to display the last recorded record in the database of SQL SERVER 2005. How can i display it with the select query in the grid view... The database contains the...
0
by: solargovind | last post by:
Hello, I have few problem with Dlookup condition. I need to retrieve next record or previous record based on certain condition. The conditions are set in in the combo box. Here, I am trying to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.