This is a discussion on "Dreamweaver ASP/Vb - Queries" within the Classic ASP section. This forum, and the thread "Dreamweaver ASP/Vb - Queries are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Dreamweaver ASP/Vb - Queries
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Dreamweaver ASP/Vb - Queries
Hi All,
I am new to ASP/VB but have come accross many ways of doing what I want to acheive so thought I would ask. I have a page with a form, the combo boxes on the form connect to the access db, I then want to query the chocies to give a result. The action of the form is to submit to the results page. I can get some results on the results page but they are not based on the user input. On the form I am using request variables and creating a recordset with sql such as select * from (db_name) where service = service variables defined as service def value =1 then Request.Form("service") Hope this makes sense, any help would be really appreciated. Thanks |
|
#2
|
|||
|
|||
|
Re: Dreamweaver ASP/Vb - Queries
Hi, i'm just starting to learn asp myself and had a similar problem as yourself. For me i used
SELECT * FROM (db_name) WHERE (what you want to use) LIKE '" & service & "' & '%' My problem is then searching multiple fields. Hope this helps |
|
#3
|
||||
|
||||
|
Re: Dreamweaver ASP/Vb - Queries
Quote:
1. You can use a * to select all fields in a table but this is not recommended because the query might bring back data you don't need and just slow things down. It's good practice to always specify which fields you need. 2. Conditions... Generally, conditions are: expression [operator] expression In addition to the standard ones (equals, less than, etc) you should also note: != Not equals (MS SQL) <> Not Equals (Access) You can organize your conditions rather like a mathematical expression. Group conditions as you like using brakets and join condition using OR / AND (There are more but you probably won't need them) 3. The LIKE operator LIKE will compare two strings almost like the equals sign (=), but it lets you match a pattern rather than a string. For example: LIKE 'a%' will match a string begining with the letter 'a' LIKE '%a' will match a string ending with the letter 'a' LIKE '%a%' will match a string that has the letter 'a' in it. More info here: http://exchange.manifold.net/manifol...E_Operator.htm
__________________
Diego - Web-Developer & London SEO Expert jQuery Plugins: Multiple File Upload, Star Rating, FCKEditor | NEW: XML to JSON
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#4
|
|||
|
|||
|
Re: Dreamweaver ASP/Vb - Queries
Thanks for that info and the link. I will changed my select statement like you suggested. A fast result is always best.
|
![]() |
| Tags |
| dreamweaver, aspvb, queries |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] How to JOIN these queries | alexgeek | Databases | 4 | Jan 18th, 2008 06:48 |
| SQL queries | alexgeek | Databases | 2 | Sep 27th, 2007 09:41 |
| Access: linking queries | djme | Databases | 0 | Oct 7th, 2006 20:24 |
| dual action queries | Daddyohhh99 | Databases | 3 | Nov 24th, 2005 16:52 |
| Union Queries | ekendricks | Databases | 4 | Oct 22nd, 2003 00:01 |