Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

Dreamweaver ASP/Vb - Queries

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.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 26th, 2006, 11:13
New Member
Join Date: Jun 2006
Location: walsall
Age: 34
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Jul 2nd, 2006, 10:49
New Member
Join Date: Nov 2005
Age: 25
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 2nd, 2006, 12:56
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,685
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Re: Dreamweaver ASP/Vb - Queries

Quote:
Originally Posted by Yofamb
SELECT *
FROM (db_name)
WHERE (what you want to use) LIKE '" & service & "' & '%'
Good, but I thought I'd contribute to this thread and pass on a bit of knowledge...
Code: Select all
SELECT Field1, Field2, Field3
FROM TableName
WHERE ((condition1 OR condition2) AND condition3)
Notes:

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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 2nd, 2006, 21:52
New Member
Join Date: Nov 2005
Age: 25
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
dreamweaver, aspvb, queries

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 16:15.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8