Arrays and Recordsets

Results 1 to 3 of 3

Thread: Arrays and Recordsets

  1. #1
    Join Date
    Dec 1969

    Default Arrays and Recordsets

    Ok using access I have 2 tables, 1 holds complete restaurant info, and the other holds restaurant ID and user ID. This gives me a user-restaurant registration but 1 user can be registered to many restaurants.<BR> <BR>Now i search for all restaurant id&#039s where they match user id SIMPLE but the return recordset holds many restaurant id&#039s. Now I have to then query the table that holds all the restaurant info to match the NAME of the restaurant by the ID but since there are so many id&#039s how do I get a valid recordset filled with the names of the restaurants? <BR><BR> Can I insert the initial ID query results into an array?<BR><BR> And if so how do I use this array of ID&#039s in a SELECT to find and match up the ID names of the second table?<BR><BR>help

  2. #2
    David Morgan Guest

    Default RE: Arrays and Recordsets

    I think you ought to read up on Join Queries.<BR><BR>This is easy if in you SQL statement, (which access will build for you), you join the &#039IDs&#039 table to the &#039Details&#039 table on RestaurantID. There is an article on this site somewhere about using join queries.<BR><BR>The best thing to do is get what you want in Access then copy the SQL version of the query to your ASP page.

  3. #3
    Sam Otto Guest

    Default RE: Arrays and Recordsets

    You should do only one query joining the tables:<BR><BR>SELECT * FROM Restaurant, UserRest WHERE Restaurant.RestID=UserRest.RestID and UserRest.UserID=" & userID<BR><BR>This will give you back a record set with columns from both tables...

Posting Permissions

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