Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003

    Angry Unanswered: 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!

  2. #2
    Join Date
    Sep 2003
    try using query builder in access then choose sql view. this is very helpful when usin join

  3. #3
    Join Date
    Sep 2003
    OMG! Thank you! I didn't know access had this feature. Boy do I feel dumb now.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts