473,382 Members | 1,583 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,382 software developers and data experts.

Recordset Display Question

I am a begginner with ASP.
Can someone help me fix this?
I am trying to display order tracking links from a DB table.

If there is a tracking link listed for a company it should display
"Track Now" as a hyperlink. If there is no order tracking link listed
it displays: "No Address".

The link displays fine if I just use:
<a href="<%=rs.Fields.Item("Order_Tracking").Value%>" ><%=rs.Fields.Item("Order_Tracking").Value%></a>
but I don't want that because some of the links are very long.

PROBLEM: I have about 50 companies to display about 30 of them has a
package tracking link provided. All displays however as "No Address".
Here is the code I would like to use. Can someone put me in the right
direction:
<%
If VIPPtracking = "" then
Response.Write("<a href=""" &
rs.Fields.Item("Order_Tracking").Value & """>Track Now</a>")

else
Response.write("No Address")
End If
%>
Jul 19 '05 #1
8 1305
Where are you giving the VIPTracking variable its value?

Ray at work
"Maria Kovacs" <ma*********@lycos.com> wrote in message
news:6f**************************@posting.google.c om...

PROBLEM: I have about 50 companies to display about 30 of them has a
package tracking link provided. All displays however as "No Address".
Here is the code I would like to use. Can someone put me in the right
direction:
<%
If VIPPtracking = "" then
Response.Write("<a href=""" &
rs.Fields.Item("Order_Tracking").Value & """>Track Now</a>")

else
Response.write("No Address")
End If
%>

Jul 19 '05 #2
> Where are you giving the VIPTracking variable its value?

Ray at work


dim VIPPtrack
dim grid_VIPPuserlinks_sql
....
sub request_grid_VIPPuserlinks
VIPPtrack = request("Order_Tracking")
....
sub validate_grid_VIPPuserlinks
VIPPtrack = trim(request("Order_Tracking"))
....
sub db_select_grid_VIPPUserLinks
grid_VIPPUserLinks_sql = "SELECT * FROM VIPP left join
VIPPUserLinks....
....
user_id = session("user_id")
if user_id <> "" then
db_select_grid_VIPPUserLinks
end if
....

<%
do while not rs.EOF
on error resume next
....
VIPPtrack = rs("Order_Tracking")
on error goto 0
%>
<table>With Order tracking code above and other related info like fax,
phone #</table>
Jul 19 '05 #3
You're testing if VIPTrack="" and if it does = "", then it should write your
link. Considering that you're assigning a value to VIPTrack in three
different places from request.? collections and from a recordset, chances
are the value is never or rarely "". Response.Write the value to see what
it is. Or just use a test if/then like so:

VIPTrack = Request.FORM("Order_Tracking")
If VIPTrack = "" Then
Response.Write "VIPTrack is not an empty string. It is: " & VIPTrack
Else
Response.Write "VIPTrack is an empty string.
End If

Also, please see here. http://www.aspfaq.com/show.asp?id=2111

Ray at home

"Maria Kovacs" <ma*********@lycos.com> wrote in message
news:6f**************************@posting.google.c om...
Where are you giving the VIPTracking variable its value?

Ray at work


dim VIPPtrack
dim grid_VIPPuserlinks_sql
...
sub request_grid_VIPPuserlinks
VIPPtrack = request("Order_Tracking")
...
sub validate_grid_VIPPuserlinks
VIPPtrack = trim(request("Order_Tracking"))
...
sub db_select_grid_VIPPUserLinks
grid_VIPPUserLinks_sql = "SELECT * FROM VIPP left join
VIPPUserLinks....
...
user_id = session("user_id")
if user_id <> "" then
db_select_grid_VIPPUserLinks
end if
...

<%
do while not rs.EOF
on error resume next
...
VIPPtrack = rs("Order_Tracking")
on error goto 0
%>
<table>With Order tracking code above and other related info like fax,
phone #</table>

Jul 19 '05 #4
I corrected all the Request.Form("item") collection names, and tried
the code you gave me.

Right now I am getting only: "VIPPtrack is not an empty string. It is:
"
no matter if there is a link or not. I never get "VIPTrack is an empty
string."
Jul 19 '05 #5
Do you expect it to be an empty string ever? What kind of form element is
it?

Ray at home
"Maria Kovacs" <ma*********@lycos.com> wrote in message
news:6f*************************@posting.google.co m...
I corrected all the Request.Form("item") collection names, and tried
the code you gave me.

Right now I am getting only: "VIPPtrack is not an empty string. It is:
"
no matter if there is a link or not. I never get "VIPTrack is an empty
string."

Jul 19 '05 #6
If I write:
<%
If VIPPtracking = "" then
Response.Write("No Address")

else
Response.write("<a href=""" & rs.Fields.Item("Order_Tracking").Value
& """>Track Now</a>")

End If
%>

Then I get "No Address" everywhere.
---
If I reverse it:
<%
If VIPPtracking = "" then
Response.Write("No Address")

else
Response.write("<a href=""" &
rs.Fields.Item("Order_Tracking").Value & """>Track Now</a>")

End If
%>

Then I get "Track Now" with the link of the portal's index page where
there is no OrderTracking link provided,
and
get "Track Now" and the corresponding company's tracking link, where
listed.

I don't understand, in the case of NO tracking link listed, why would
it use the portal's index page as a link?
Jul 19 '05 #7
This problem has nothing to do with writing links, portals, or recordsets or
anything like that. It is all about the value of VIPTracking.

Ray at home

"Maria Kovacs" <ma*********@lycos.com> wrote in message
news:6f**************************@posting.google.c om...
If I write:
<%
If VIPPtracking = "" then
Response.Write("No Address")

else
Response.write("<a href=""" & rs.Fields.Item("Order_Tracking").Value
& """>Track Now</a>")

End If
%>

Then I get "No Address" everywhere.
---
If I reverse it:
<%
If VIPPtracking = "" then
Response.Write("No Address")

else
Response.write("<a href=""" &
rs.Fields.Item("Order_Tracking").Value & """>Track Now</a>")

End If
%>

Then I get "Track Now" with the link of the portal's index page where
there is no OrderTracking link provided,
and
get "Track Now" and the corresponding company's tracking link, where
listed.

I don't understand, in the case of NO tracking link listed, why would
it use the portal's index page as a link?

Jul 19 '05 #8
Have you tried Response.Write ( Request.Form("Order_Tracking")) with no logic around it, as Ray suggested?

If it does have a value, then try this.....

When I've run into this problem, this seems to do the trick....
<%
If Not VIPPtracking = "" then

Response.write("<a href=""" & rs.Fields.Item("Order_Tracking").Value & """>Track Now</a>")

else
Response.Write("No Address")

End If
%>

Bob Lehmann

"Maria Kovacs" <ma*********@lycos.com> wrote in message news:6f**************************@posting.google.c om...
If I write:
<%
If VIPPtracking = "" then
Response.Write("No Address")

else
Response.write("<a href=""" & rs.Fields.Item("Order_Tracking").Value
& """>Track Now</a>")

End If
%>

Then I get "No Address" everywhere.
---
If I reverse it:
<%
If VIPPtracking = "" then
Response.Write("No Address")

else
Response.write("<a href=""" &
rs.Fields.Item("Order_Tracking").Value & """>Track Now</a>")

End If
%>

Then I get "Track Now" with the link of the portal's index page where
there is no OrderTracking link provided,
and
get "Track Now" and the corresponding company's tracking link, where
listed.

I don't understand, in the case of NO tracking link listed, why would
it use the portal's index page as a link?

Jul 19 '05 #9

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

Similar topics

4
by: Bryan | last post by:
I have a results table that is 5 columns wide. the recordset is returned with 48 items. I have no problem displaying 5 per row until I hit the last row where i get a ADODB.Field error '80020009' ...
2
by: Rob Meade | last post by:
Lo all, I have a local recordset which is not linked to a database. Some of the fields in this recordset contain html tags. I have a function which is called when I'm calculating my...
8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
0
by: huela | last post by:
Somehow i have to display the recordset in unbound form When i use the following display the data in recordset to unbound form. I have a question: i can only display the last record data, all...
2
by: Lyn | last post by:
Hi, I am opening a form in Continuous mode to list the records from a recordset created in the calling form. The recordset object is declared as Public and is set into the new form's Recordset...
13
by: Jan | last post by:
Hi I have a database that I use to keep track of the sales promotions that we send to companies. I normally send a mailing based on a subset of the companies in the database (found using the...
11
by: altreed | last post by:
Hi, I am new to ASP, HTML and iis. I have my asp code working so that I can retrieve my desired record from the database. I can place the data on the screen in table form. All works fine. ...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.