-
OpenRecordSet question
Say in my Access database I have 5 tables.
Now would I have to use a separete instance for each table
like
Set rstInfo = .OpenRecordset("Info")
Set rstCustomer = .OpenRecordset("Customer")
Set rstEmployee = .OpenRecordset("Employee")
Or could I put them all into once instance
Set rstInfo = .OpenRecordset("Customer" & "Employee" & "Info")
Or something like that, as I'm not sure how the 2nd way would work if it's possible.
-
Egads!
Don't!
Use ADO/SQL.
With ADO, you can just have one table open at a time, or many in separate recordsets, or whatever you want.
If you refuse, then you need a new RecordSet for each table. Trust me, use ADO.
-
You can use straight SQL to open mutiple tables:
Code:
dim rs as new adodb.recordset
dimr strSQL as string
strSQL = "SELECT * from Table1,table2 where table1.id=table2.p_ID"
rs.open strsql,objConn,adOpenForwardOnly, adLockReadOnly
-
You may want to use some JOINS in there too...
-
Yeah, i guess it depends on the DBMS you are using. The JOIN keyword is not really necessary. It just makes it look nicer. If I remember correctly Oracle does not even support the join clause.