473,800 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Fie lds.Item("Order _Tracking").Val ue%>"><%=rs.Fie lds.Item("Order _Tracking").Val ue%></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 1319
Where are you giving the VIPTracking variable its value?

Ray at work
"Maria Kovacs" <ma*********@ly cos.com> wrote in message
news:6f******** *************** ***@posting.goo gle.com...

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_VIPPuserli nks_sql
....
sub request_grid_VI PPuserlinks
VIPPtrack = request("Order_ Tracking")
....
sub validate_grid_V IPPuserlinks
VIPPtrack = trim(request("O rder_Tracking") )
....
sub db_select_grid_ VIPPUserLinks
grid_VIPPUserLi nks_sql = "SELECT * FROM VIPP left join
VIPPUserLinks.. ..
....
user_id = session("user_i d")
if user_id <> "" then
db_select_grid_ VIPPUserLinks
end if
....

<%
do while not rs.EOF
on error resume next
....
VIPPtrack = rs("Order_Track ing")
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("O rder_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*********@ly cos.com> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
Where are you giving the VIPTracking variable its value?

Ray at work


dim VIPPtrack
dim grid_VIPPuserli nks_sql
...
sub request_grid_VI PPuserlinks
VIPPtrack = request("Order_ Tracking")
...
sub validate_grid_V IPPuserlinks
VIPPtrack = trim(request("O rder_Tracking") )
...
sub db_select_grid_ VIPPUserLinks
grid_VIPPUserLi nks_sql = "SELECT * FROM VIPP left join
VIPPUserLinks.. ..
...
user_id = session("user_i d")
if user_id <> "" then
db_select_grid_ VIPPUserLinks
end if
...

<%
do while not rs.EOF
on error resume next
...
VIPPtrack = rs("Order_Track ing")
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("i tem") 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*********@ly cos.com> wrote in message
news:6f******** *************** **@posting.goog le.com...
I corrected all the Request.Form("i tem") 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*********@ly cos.com> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
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("O rder_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*********@ly cos.com> wrote in message news:6f******** *************** ***@posting.goo gle.com...
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
3980
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' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. My question is how do I close of the table row when I reach the EOF? i.e
2
1789
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 relevance for search results which gets the row from the recordset, strips out the html tags, then does its magic to produce the 'relevance' for that row.
8
2307
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 fine I think) that will say "I'm sorry but the data you requested cannot be found" or something along those lines.... This code is on an archive page I have on my company's intranet....The end result is to show 3 records at a time pulled from an...
25
10275
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
0
464
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 previous data are overwrittend. why i can't create the continues form or datasheet display the data line by line. Thanks a lot for the help
2
2330
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 property during the Open event. According to the VBA Help file, setting the Recordset property may adjust the RecordSource property accordingly. If I set the RecordSource to blank in Design mode, it remains blank when the form is opened even...
13
3487
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 query: QryICTMassDistribution3) , I then use a form and the code below to create a new record in the corrispondence table to show what corrispondence has been sent to various companies.
11
2740
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. I wish to evaluate one field in the record and depending on the value in that field I wish to change the colour of the line in the table. As
0
9014
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 Recordset? Does the Recordset support Bookmarks? Can we use the Find and/or Seek Methods with this Recordset? Does the Recordset support the use of Indexes? Will the Absoluteposition property be able to be used on this Recordset? etc....
2
5520
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 results page. - Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code): SELECT * FROM db_name WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
0
9555
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10514
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
10287
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...
0
10042
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9099
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...
1
7588
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6826
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
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4156
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

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.