If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP SQL Statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-25-03, 14:47
Deviless Deviless is offline
Registered User
 
Join Date: Sep 2003
Posts: 2
Angry ASP SQL Statement

Hi there! I'm new here I hope someone can help me because I'm at a loss.

I have an SQL statment that is giving me an error. It's probably a syntax error that i'm not seeing.

This is my code and it's giving me the following error

sql = "SELECT Survey.Topic, Survey.ExpertID, Survey.[Last Name], Survey.[First Name] FROM Survey INNER JOIN TopicTable ON (TopicTable.TopicID = Survey.Topic) OR (TopicTable.TopicID = Survey.Topic2) OR (TopicTable.TopicID = Survey.Topic3) OR (TopicTable.TopicID = Survey.Topic4) OR (TopicTable.TopicID = Survey.Topic5) WHERE (((TopicTable.TopicID)=" & Request.QueryString("TopicID") & ")) "

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.

I'm using Access as a database and I hvave two tables in the database. One called TopicTable with fields called TopicID and Topic. I have another table called Survey with 5 topic fields. (Topic, Topic2. Topic3. Topic4, Topic5) that are linked by TopicID and Topic in the TopicTable table. In Survey are also a bunch of other fields that are users information.

What I'm trying to do is have a page that lists the topics and has the TopicID embeded in the link (I have that working). This link will take you to a list of users in the database who are in this Topic category. If I use the following code it works but only for one topic category per user:

sql = "SELECT Survey.Topic, Survey.ExpertId, Survey.[Last Name], Survey.[First Name] FROM Survey INNER JOIN [TopicTable] ON TopicTable.TopicID = [Survey].Topic WHERE (((TopicTable.TopicID)=" & Request.QueryString("TopicID") & ")) "

What I need is to be able to have each user linked to a max of 5 topics and a minimum of 1.

I hope this makes sense. It's probably something really simple.

Any help is greatly appreciated!
Reply With Quote
  #2 (permalink)  
Old 09-25-03, 15:41
wadecarlson wadecarlson is offline
Registered User
 
Join Date: Sep 2003
Posts: 6
try using query builder in access then choose sql view. this is very helpful when usin join
Reply With Quote
  #3 (permalink)  
Old 09-26-03, 14:42
Deviless Deviless is offline
Registered User
 
Join Date: Sep 2003
Posts: 2
OMG! Thank you! I didn't know access had this feature. Boy do I feel dumb now.

Thanks!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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