Connecting to specific tables

Results 1 to 2 of 2

Thread: Connecting to specific tables

  1. #1
    Join Date
    Dec 1969

    Default Connecting to specific tables

    If I have 10 tables in my Access MDB, tbl_1, tbl_2, etc., how do I specify which table to connect to? Do I need a separate DSN for each table?<BR><BR>Thanks!<BR>-Rick

  2. #2
    Join Date
    Dec 1969

    Default NO, use Recordset object

    Just as you create the connection object, create a recordset object and open the recordset. You can reuse the same connection object for different recordsets.<BR><BR>Set rs1 = Server.CreateObject("ADODB.Recordset")<BR>sql = "select * from tb_1"<BR>rs1.Open sql, connection_object<BR><BR>Set rs2 = Server.CreateObject("ADODB.Recordset")<BR>sql = "select * from tb_2"<BR>rs2.Open sql, connection_object<BR><BR>Read a book on ADO, it will do you good in the long run.

Posting Permissions

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