Author |
Topic |
|
SideFFect
Starting Member
Canada
4 Posts |
Posted - August 09 2007 : 11:57:06
|
Hey guys, I just started working on my boss's website and he uses the VP-ASP cart program.
I didn't get any information on it however, so was forced to try to understand all the main files by myself...has been...entertaining to say the least.
Anyways, I am trying to access the DB to retrieve items for display on the default.asp page
My code looks like this:
<table border="2" cellspacing="0" cellpadding="0"> <tr><td> <% Dim dbc InitializeSystem ShopOpenDatabaseP dbc CheckDatabaseOpen dbc Showprod ShopCloseDatabase dbc Sub ShowProd() Dim rs dim catalogid SQL="Select cname from products where catalogid = 9" set rs = dbc.execute(SQL) OpenRecordSet dbc, rs, sql While Not rs.EOF catalogid=rs("catalogid") rs.MoveNext Wend response.write "</center></table>" CloseRecordSet rs end sub %></td></tr></table>
This is just under the include files and an already placed <%InitializeSystem%> command.
Problem is, when I try the page, I get a HUGE space where the table should be and my products that were listed normally on default.asp get pushed WAY down.
If I change anything I get an Internal 500 error.
Is there anything wrong with my code? Any advice/tips are welcome!
Thanks,
- SideFFect -
|
|
SideFFect
Starting Member
Canada
4 Posts |
Posted - August 09 2007 : 12:03:11
|
Sorry I meant SQL = "Select * from products where catalogid=9"
and it then shows the huge space and a tiny black box where the table should be (except for the fact that nothing is being retrieved from the database)
Thanks again! |
|
|
SideFFect
Starting Member
Canada
4 Posts |
Posted - August 09 2007 : 12:11:46
|
Wow, I think I got it! (and I didn't have the set rs = dbc.execute(SQL) before in order for it to work, sorry about the confusion)
I deleted:
While Not rs.EOF catalogid=rs("catalogid") rs.MoveNext Wend
Changed SQL= Select cname from products where catalogid=9 and response.write rs("cname")
And it FINALLY displayed the name in my table! Jesus that took long to grasp lol
|
|
|
support
Administrator
4679 Posts |
Posted - August 14 2007 : 22:59:45
|
You could try using the folllwing instead of custom coding:
[Add_randomproducts]
This will allow you to display products from the database on the home page.
You can download our user Guide from: http://www.vpasp.com/helpnotes
Thanks Cam
VP-ASP Support |
|
|
|
Topic |
|