ASP ADO SQL Query

This is a discussion on "ASP ADO SQL Query" within the Classic ASP section. This forum, and the thread "ASP ADO SQL Query are both part of the Program Your Website category.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 26th, 2005, 03:56
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ASP ADO SQL Query

I'm having trouble thinking how to write a query ... i have two tables customer and contact ...they share a common element of customerID ... their is a login form based on the contactID, contactPassword within the contact table, based on that i want the contactID and customerID of contact, to display the fields of the customer table ...

Anyone keep up with that?
Reply With Quote

  #2 (permalink)  
Old May 26th, 2005, 06:09
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Code: Select all
SELECT contact.contactID, contact.contactPassword, customer.* FROM contact INNER JOIN customer ON contact.customerID = customer.customerID
Reply With Quote
  #3 (permalink)  
Old May 26th, 2005, 08:37
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Isnt that for all Customer ID?

What would you have to do for a particular Customer ID...

Reply With Quote
  #4 (permalink)  
Old May 26th, 2005, 08:44
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Add:
Code: Select all
where customerID = ...
Reply With Quote
  #5 (permalink)  
Old May 26th, 2005, 08:53
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by D3mon
Add:
Code: Select all
where customerID = ...
But thats part of the problem ...

... we input the contactID, and therefore its the corresponding customerID ... but how do we write that?
Reply With Quote
  #6 (permalink)  
Old May 26th, 2005, 13:03
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
Is it this simple

Code: Select all
SELECT
	Col1,
	Col2,
	etc
FROM contact X
	JOIN customer Y
		ON x.CustomerID = y.CustomerID
WHERE X.ContactID = 'blah'
Reply With Quote
  #7 (permalink)  
Old May 27th, 2005, 03:34
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Trebz
Is it this simple

Code: Select all
SELECT
	Col1,
	Col2,
	etc
FROM contact X
	JOIN customer Y
		ON x.CustomerID = y.CustomerID
WHERE X.ContactID = 'blah'
Code: Select all
SELECT *
FROM contact
	JOIN customer
		ON contact.CustomerID = customer.CustomerID
WHERE contact.ContactID = Request.form("username")
... like that?
Reply With Quote
  #8 (permalink)  
Old May 27th, 2005, 03:39
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
I guess not ... doesnt return any values ....

Reply With Quote
  #9 (permalink)  
Old May 30th, 2005, 09:30
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
Could you maybe explain the question a little clearer please, I can't quite understand what you need.

Cheers
Reply With Quote
  #10 (permalink)  
Old May 30th, 2005, 09:32
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
I have to say, I'm a little confused too... :S
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #11 (permalink)  
Old Jun 18th, 2005, 15:12
New Member
Join Date: Jun 2005
Location: USA
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to HostBreak
Quote:
Originally Posted by rob
I have to say, I'm a little confused too... :S
Me Too!
Reply With Quote
Reply

Tags
asp, ado, sql, query

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
Nav bar query Scottie Starting Out 10 Jun 9th, 2008 21:23
query about my $query ziggi PHP Forum 9 Aug 10th, 2007 14:05
MySQL query query dangergeek Databases 3 Apr 12th, 2007 12:45
SUBSTRING in query contiw Databases 0 Oct 11th, 2006 19:23
Query accessman Databases 0 Sep 22nd, 2005 19:48


All times are GMT. The time now is 21:04.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43