Forums

This topic is locked

advanced RecordSet help please

Posted 24 Jun 2003 10:52:10
1
has voted
24 Jun 2003 10:52:10 Ted Rogers posted:
i have a Relational database, 2 tables, a one-to-many relationship, primary and foreign keys are established.

i'm trying to create a Detail page that shows one record, here's my situation:
if i was doing this so that the 'record called' only displayed data available from one table then i could establish a RecordSet using the "Simple" view of the RecordSet creation dialog and use a filter to pass a url parameter (?), but i want the record shown to have a couple rows (fields) that are from the second, "related", table.
i think the way this must be done is by using the "Advanced" view of the RecordSet creation dialog.
in the Advanced dialog i don't know how to accomplish what the "Filter" would do in the "Simple" view.
i guess i need to put something in the Variable area? but i have little [no] idea of what to put there.

here is the SQL i'm using:
SELECT lastname, firstName, model, location, propID, IP FROM people, machines WHERE machines.peopleID =
people.peopleID;

i have no idea what to put for the proper variable to create the proper parameters for the url?
this RecordSet will be used as the Detail page of a Delete Record page <<-- that's what i'm trying to create.

have i explained it OK? i barely know what i'm doing, please give me a hand?

thanks in advance,


ted

Replies

Replied 24 Jun 2003 12:59:23
24 Jun 2003 12:59:23 Owen Eastwick replied:
I assume you are using MS Access Database.

Open Create Query in design view in Access, Drag the relevant fields fro the respective tables in order to create the result set you require. If the tables are related to each other, Access will create the Inner Join required to retrieve fields from related tables for you.

Once you have the query returning the fields you require switch to SQL View, now you can paste the SQL SELECT code that Access has created fro you into the Macronmedia SQL box in the Recordset pallete, add the WHERE clause you require to the SELECT statement, something like:

WHERE RecordID = varRecId

Now cick the + button above the variables box and add the variable: varRecId and the run time value Request("RecID" to the box.

Take a look at www.tdsf.co.uk/tdsfdemo/Tutorial07.htm for more information on creating queries in Access and setting up recordsets in advanced view.

Regards

Owen.

-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only): www.tdsf.co.uk/tdsfdemo/Shop.htm

Developer services and tutorials: www.drdev.net

Multiple Parameter UD4 / Access 2000 Search Tutorial: www.tdsf.co.uk/tdsfdemo/

Reply to this topic