Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > VB Classic

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 08-27-2002, 05:27 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
sql select with where clause

[Originally posted by jack]

Ok I have now tried to use an sql statement, like this

<!--#include file="Email_datalink.asp"-->
Dim objrs
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open objConn˙ ˙ ˙ ˙ ˙ 'from include file at top of page
strSQL = "SELECT * FROM qrycc_main " _
˙ ˙ ˙  & "WHERE Resort LIKE '" & Request.Form("dropresort") & "'"
Set oRs = oConn.Execute(strSQL)


How do I pass another field into the where clause form the request page??

any help very much appreciated
Cheers Jack
Reply With Quote
  #2  
Old 08-27-2002, 07:13 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:sql select with where clause

[Originally posted by JAG]

use an AND

SELECT * FROM table WHERE columA='x' and columB ='y'

grtz
<b>JAG</b>
Reply With Quote
  #3  
Old 08-27-2002, 07:28 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Re:sql select with where clause

[Originally posted by jack]

But I need to pass the values as two variables from one request page with two drop down boxes which act as user choices, so I cant just write the values in!!
Jack
Reply With Quote
  #4  
Old 08-27-2002, 06:36 PM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Re:Re:sql select with where clause

[Originally posted by gonzalo]

did you tryed to use 2 different sql commands?
one for each drop down boxes?
Reply With Quote
  #5  
Old 08-27-2002, 07:18 PM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
how to select latest data from database

[Originally posted by k2]

how to select latest data from database ???
Reply With Quote
  #6  
Old 09-14-2002, 08:36 PM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:sql select with where clause

[Originally posted by Bernie Lawrence]

You can have as many fields passed and used in the sql statement as you want.˙ For instance, if you also wanted to make sure the Location was equal to something and you passed it the input from your form as location then you could add it to the SQL statement as follows.

strSQL = "SELECT * FROM qrycc_main " _
˙ ˙ ˙ & "WHERE Resort LIKE '" & Request.Form("dropresort") & "' AND Location LIKE '" & Request.Form("location") & "'"

Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:54 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.