|
-
Dec 4th, 2001, 06:49 PM
#1
Thread Starter
Lively Member
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.
Vini, Vidi, Vici!
-----------------
say this 5 times fast
"I am not a pheasant plucker, I'm a pheasant plucker's son. I'm only plucking pheasants, till the pheasant plucker comes."
-
Dec 4th, 2001, 11:14 PM
#2
PowerPoster
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.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Dec 4th, 2001, 11:38 PM
#3
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
-
Dec 4th, 2001, 11:47 PM
#4
PowerPoster
You may want to use some JOINS in there too...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Dec 4th, 2001, 11:49 PM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|