Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 1st, 2005, 05:19 PM
phillip phillip is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 phillip User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 23 m 51 sec
Reputation Power: 0
Help me plzzzz

I'm a newbie in ASP. I doing my project and get an error, hard to improve.It's run but not appear anything


<%
Dim adoCon 'Holds the Database Connection Object
Dim rsAddComments 'Holds the recordset for the new record to be added
Dim strSQL 'Holds the SQL query to query the database

Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("add_to_newuser.mdb")
Set rsAddComments = Server.CreateObject("ADODB.Recordset")
set category=trim(Request("Pro_type"))
strSQL = "SELECT * FROM Products WHERE Pro_type='"+category+"'"
rsAddComments.Open strSQL, adoCon
do While not rsAddComments.eof
%>
<tr>
<td height="135" width="115"><IMG scr='<%=rsAddComments("Pro_img")%>'></td>
<td height="135" width="181">
<a href = Details.asp?Pro_code=<%rsAddComments("Pro_code")%>>
<b><%=rsAddComments("Pro_name")%></b>
</a><br>
<%=rsAddComments("Pro_des")%> <br>
<img src="image/saleTag1.gif" width="57" height="32"> <br>
<%=rsAddComments("Price")%> $ <br>
<%=rsAddComments("Pro_code")%> <br>
<a href=ShoppingCart.asp?option=add&id=<%=rsAddComments("Pro_Id")%> >
<img src="image/order.gif" width="55" height="15">
</a>
</td>
</tr>
<% rsAddComments.MoveNext
Loop
rsAddComments.Close
%>


So anyone can help me !!!(I want show Product image,Product code, Price )

Reply With Quote
  #2  
Old March 1st, 2005, 08:52 PM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,381 lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 22 h 21 m 10 sec
Reputation Power: 1488
Post your error.
Before seeing the error, I'd like to take a good guess that this:
Code:
 strSQL = "SELECT * FROM Products WHERE Pro_type='"+category+"'"

is causing the error.
It should be:
Code:
 strSQL = "SELECT * FROM Products WHERE Pro_type='"&category&"'"
__________________
................... ASCII and ye shall receive ..................
Knowledge is the only resource on earth that multiplies when shared


Support the Shemzilla Project
Powered by C#

Reply With Quote
  #3  
Old March 1st, 2005, 10:41 PM
banker's Avatar
banker banker is offline
Charging Rhino Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Dec 2004
Location: 127.0.0.1
Posts: 2,053 banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 23 h 28 m 28 sec
Reputation Power: 36
a good way to debug these type of errors is to put this code right after the strSQL = "....." statement:
Code:
response.write strSQL
response.end

this will let you know what connection object is trying to send as your SQL request.

Reply With Quote
  #4  
Old March 2nd, 2005, 05:36 AM
phillip phillip is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 phillip User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 23 m 51 sec
Reputation Power: 0
i'm edited but it's still got another error
likes this
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: '[string: "Bakery"]'
/project/linktocatalogue.asp, line 9

this is my whole code and database:
http://s35.yousendit.com/d.aspx?id=0UQZD382Y14BE2HQHT7AGS9XWF

help me plzzzz.

Reply With Quote
  #5  
Old March 2nd, 2005, 07:06 AM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,381 lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 22 h 21 m 10 sec
Reputation Power: 1488
In your code, I didn't see where the field Pro_Type is coming from.
set category=trim(Request("Pro_type"))
You must have a page where you provide your users with the description of your products.
Code:
<html>
  <body>
  <form name="main" action="linktocatalogue.asp" method="post">
  Please Choose a product type
  <br />
  <select name="Prod_Type" onChange="this.form.submit();">
  <option>Please Select One</option>
  
  <% 
  Dim rs
  Dim con
  
  Set rs = Server.CreateObject("ADODB.Recordset")
  Set con = Server.CreateObject("ADODB.Connection")
  
  con.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("add_to_newuser.mdb")
  
  Sql = "Select Pro_Type from Products"
  
  rs.open Sql, con
  
  While not rs.eof
     Response.Write "<option value=" & rs("Pro_Type") & ">" & rs("Pro_Type") & "</option>"
    rs.MoveNext
  Wend
  
  'reclaim system resources
  rs.close
  con.close
  Set rs = Nothing
  Set con = Nothing
  %>
  </form>
  </body>
  </html>

Save this as "selectProduct.asp"
then change this portion of lintocatalogue:
Code:
set category=trim(Request("Pro_type"))

to:
Code:
set category=Request.Form("Pro_type")

Reply With Quote
  #6  
Old March 3rd, 2005, 08:54 PM
phillip phillip is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 phillip User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 23 m 51 sec
Reputation Power: 0
sorry, it's not on my ways.When you run defaut.asp, the main page is open include all pro_type, the pro_type on defaut.asp will refer to catelogue.asp to show all the pro_type like pro_name,pro_dis,pro_image and Price in which mouse click.Thanks lewy but on my way is different.My ideal likes this site : http://www.efaucets.com/brizo-faucets.asp when you click on Kitchen - one handle , the next page will show all thing on one handle likes http://www.efaucets.com/search_results.asp?txtsearchParamTxt=&txtsearchParamType=ALL&txtsearchParamCat=2&txtsearchParamMan=25&txtsearchParamVen=ALL&txtPriceStart=&txtPriceEnd=&txtFromSearch=fromSearch&iLevel=1&btnSearch.x=50&btnSearch.y=9, I want do like that, help me one more times , plzzz

Reply With Quote
  #7  
Old March 4th, 2005, 08:47 AM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,381 lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 22 h 21 m 10 sec
Reputation Power: 1488
Quote:
Originally Posted by phillip
sorry, it's not on my ways.When you run defaut.asp, the main page is open include all pro_type, the pro_type on defaut.asp will refer to catelogue.asp to show all the pro_type like pro_name,pro_dis,pro_image and Price in which mouse click.Thanks lewy but on my way is different.My ideal likes this site : http://www.efaucets.com/brizo-faucets.asp when you click on Kitchen - one handle , the next page will show all thing on one handle likes http://www.efaucets.com/search_resu...0&btnSearch.y=9, I want do like that, help me one more times , plzzz

The search works good on this site, What do you have in mind?

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Help me plzzzz


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT