SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

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 June 11th, 2000, 02:18 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
passing params in Select statment

<i><b>Originally posted by : K. St-Louis (kstlouis@canada.com)</b></i><br />I'm very new to asp....so bear with me.<br /><br />I have:<br />chemistry.asp<br /><% <br /><br /><br /> set MyConn = Server.CreateObject("adodb.connection") <br /> MyConn.Open "DSN=PMRA"<br /><br /> level=Request.QueryString("level") <br /> sql = "SELECT DISTINCT Review.*, DACO.* " &_<br /> "FROM Review, daco " &_<br /> "WHERE Review.Subn='2000-0002' and DACO.Division_id='LSD' and Daco.Daco_ID=Review.Daco_ID and Review.Level_ID='level' " &_<br /> "ORDER BY DACO.Daco_id"<br /> SET rst = MyConn.Execute(sql) %><br /><br />My problem is with the querystring that requests level... If I replace Review.Level_ID= with a correct value of 'C1', I get the<br />correct records that I require. If I pass the value ..<a href="chemistry.asp?level=C1">, I get nothing. <br />Am I doing something wrong?<br /><br />kstlouis<br /><br />

Reply With Quote
  #2  
Old June 19th, 2000, 10:55 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : </b></i><br />The way you are doing it is to find a record where Review.Level_ID='level', which doesn't exist in the table, so you got nothing. To get the value of the query string, the right way is:<br /><br />WHERE Review.Subn='2000-0002' and DACO.Division_id='LSD' and Daco.Daco_ID=Review.Daco_ID and Review.Level_ID=' " &_<br />request.querystring("level") & "'" &_<br />"ORDER BY DACO.Daco_id"<br />SET rst = MyConn.Execute(sql) %><br /><br />Carol<br /><br />------------<br />K. St-Louis at 6/11/2000 12:18:15 AM<br /><br />I'm very new to asp....so bear with me.<br /><br />I have:<br />chemistry.asp<br /><% <br /><br /><br /> set MyConn = Server.CreateObject("adodb.connection") <br /> MyConn.Open "DSN=PMRA"<br /><br /> level=Request.QueryString("level") <br /> sql = "SELECT DISTINCT Review.*, DACO.* " &_<br /> "FROM Review, daco " &_<br /> "WHERE Review.Subn='2000-0002' and DACO.Division_id='LSD' and Daco.Daco_ID=Review.Daco_ID and Review.Level_ID='level' " &_<br /> "ORDER BY DACO.Daco_id"<br /> SET rst = MyConn.Execute(sql) %><br /><br />My problem is with the querystring that requests level... If I replace Review.Level_ID= with a correct value of 'C1', I get the<br />correct records that I require. If I pass the value ..<a href="chemistry.asp?level=C1">, I get nothing. <br />Am I doing something wrong?<br /><br />kstlouis<br /><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > passing params in Select statment


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 3 hosted by Hostway