mann95 Posted December 24, 2005 Share Posted December 24, 2005 I'm trying to create a search facility which will allow users to find products according to price. I have created two drop down menus which will allow users to search between two values. I have assigned the variable name "lowstring" to the first drop menu and "highstring" to the second drop down menu. The two variables are being taken from the form successfully. I am not sure whether i have written the sql correctly or if I should have used a less than and greater than. <%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("\n0253071\db\assignment1.mdb"))set rs = Server.CreateObject("ADODB.recordset")lowstring=Request.form("lower")highstring=Request.form("higher")rs.Open "SELECT * FROM Books WHERE Price BETWEEN '%" & highstring & "%' AND '%" & lowstring & "%' ORDER BY BookTitle",conn%> Any help much appreciatedCheersCM Link to comment Share on other sites More sharing options...
Guest الصا Posted January 3, 2006 Share Posted January 3, 2006 OoopsIts not clearly :)Can you write all attribute , then Iam tring to help you Link to comment Share on other sites More sharing options...
bolado Posted January 11, 2006 Share Posted January 11, 2006 rs.Open "SELECT * FROM Books WHERE Price BETWEEN " & highstring & " AND " & lowstring & " ORDER BY BookTitle",conn%> Hope this helps... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now