Can I select data from more than 1 table to a Recordset?

Results 1 to 2 of 2

Thread: Can I select data from more than 1 table to a Recordset?

  1. #1
    Ting Guest

    Default Can I select data from more than 1 table to a Recordset?

    I want to use data from 3 tables in the same time. Those 3 tables use ID field as a primary key. Can I select data from those 3 tables in one statement, and keep the result in one Recordset?

  2. #2
    Join Date
    Dec 1969
    Posts
    1,315

    Default RE: Can I select data from more than 1 table to a Recordset?

    Certainly.<BR>I assume you mean 3 different ID fields used as primary keys.<BR>The SQL string you create is the one that determines the data<BR>from which tables you collect to create a recordset.<BR>Assume you have set up a connection Conn, you can write:<BR><BR>SQL = "SELECT Table1.*, Table2.*, Table3.* "<BR>SQL = SQL & "FROM Table1, Table2, Table3 "<BR>SQL = SQL & "WHERE..(type the join fields here).. "<BR><BR>Set rs = Conn.Execute(SQL)<BR><BR>rs now contains data from the 3 tables.<BR><BR>John Weeflaar<BR>

Posting Permissions

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