VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 General help me questions
 ASP Coding Help Needed
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jbtinker
Starting Member

6 Posts

Posted - February 23 2005 :  17:52:22  Show Profile  Visit jbtinker's Homepage  Reply with Quote
Hi.

I need to add a link on our shopthanks.asp page and was wondering if anybody could help me with some ASP?

I need to generate a link that looks like this:
somepage.html?courseID=100801,670481,327491
where the numbers are the catalogID's for all of the products whose catalogID ends in 1 in the current order.

I am not very good with ASP, but know a little bit.

So far I have added these lines to shopthanks.asp at line 130:

sql = "SELECT catalogID FROM oitems WHERE orderID = 81 AND catalogID like '%1' "
Set rs = myconn.Execute(SQL)
oleCodes=rs("catalogID")
Response.Write ("a href='somepage.html?courseID='" & oleCodes & "'")


This has let me write out a link, with which I can link to one courseID but I need to be able to add extra catalogID's with comma's in the middle to link to more than one courseID. Is there a way in ASP that I can assign all of the productID's in an order to the one variable separated by commas?

Any help would be greatly appreciated.

StevenWWinters
Starting Member

47 Posts

Posted - February 24 2005 :  10:40:25  Show Profile  Reply with Quote
Not exactly sure what you're trying to do as your example link wouldn't work. For starters, it would have to be somepage.asp, not .html

But based on what you have written you could do something like this:

'======

Dim rs, SQL, bFirst

SQL= "SELECT catalogID FROM oitems WHERE orderID = 81 AND catalogID like '%1' "

Set rs = myconn.Execute(SQL)

Response.Write "a href='somepage.asp?courseID='"

bFirst = True

Do While NOT rs.Eof
If bFirst = True Then
bFirst = False
Else
Response.Write ","
End If

Response.Write rs("catalogID")
rs.MoveNext

Loop

'=====

sompage.asp would then have to be written to parse courseID=100801,670481,327491 and do whatever you are trying to accomplish with it.


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000