navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Drop Down sql select value

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Drop Down sql select value
Page: [1]
 
chadb

 

Posts: 468
From: Kansas
Status: online

 
Drop Down sql select value - 5/7/2008 11:48:38   
I have a dropdown list that I am trying to select that value from. Here is the drop down box:
<select size="1" name="WorkCenter">
<option selected value="%">All</option>
<option value="Assy">Assembly</option>
<option value="3SCREW">Screw</option>
</select>

here is the select statement.

fp_sQry="SELECT * FROM Item WHERE (wc like '::workcenter::')"

It will not return any records, if I change it to one of the values of the drop down, it works:
fp_sQry="SELECT * FROM Item WHERE (wc = 'assy')"
rdouglass

 

Posts: 9137
From: Biddeford, ME USA
Status: online

 
RE: Drop Down sql select value - 5/7/2008 12:42:27   
quote:

WHERE (wc like '::workcenter::')"


Like requires the "%" wildcard character.

(wc like '%::WorkCenter::%') : "contains"
(wc like '::WorkCenter::%') : "begins with"
(wc like '%::WorkCenter::') : "ends with"

That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to chadb)
chadb

 

Posts: 468
From: Kansas
Status: online

 
RE: Drop Down sql select value - 5/7/2008 12:46:00   
could I use fp_sQry="SELECT * FROM Item WHERE (wc = '::assy::')" if it is the exact value I have in <option value="Assy">Assembly</option> ?? Because this does not work.

(in reply to chadb)
rdouglass

 

Posts: 9137
From: Biddeford, ME USA
Status: online

 
RE: Drop Down sql select value - 5/7/2008 12:50:00   
quote:

fp_sQry="SELECT * FROM Item WHERE (wc = '::assy::')"


Nope, because "assy" is not the name of the form field.

See the :: double colon sign in the FrontPage DRW is kinda' shorthand for "Request.Form" so what you're saying is Request.Form("assy") which there is none.

You can do:

"SELECT * FROM Item WHERE (wc = 'assy')"

but that's hard-coding the value and I don't think that's what you want to do is it?

Also, double check your capitalization for your fields and such; it can make a diff.

Hope it helps.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to chadb)
chadb

 

Posts: 468
From: Kansas
Status: online

 
RE: Drop Down sql select value - 5/7/2008 12:54:32   
OK, so (wc = '::assy::')" the assy needs to be the name of the drop down box, in my case WorkCenter, so (wc = '::WorkCenter::')" then the sql string would be, if the value if the dropdown box is "Assy" is would be (wc = 'Assy')" right??

Thanks

(in reply to rdouglass)
DesiMcK

 

Posts: 407
Joined: 4/26/2004
From: Essex, UK
Status: offline

 
RE: Drop Down sql select value - 5/7/2008 14:51:29   
Hi chadb,

quote:

so (wc = '::assy::')" the assy needs to be the name of the drop down box, in my case WorkCenter, so (wc = '::WorkCenter::')" then the sql string would be, if the value if the dropdown box is "Assy" is would be (wc = 'Assy')" right??


You are right. Hope it works,

Desi

(in reply to chadb)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Drop Down sql select value
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts