Need to create recordset from 2+ tables with read/write 
Author Message
 Need to create recordset from 2+ tables with read/write

I am using vb50 and Access97 to create a small office inventory db.  I
have multiple tables set up that represent printers, toner cartridges,
users, etc.  They are all related by the appropriate printer id, toner
id, etc.  If I create a recordset with fields from more that one table
(which I must obviously do), I can't write changes to the multiple
fields.  I get an error stating that the recordset was opened as
read-only.  Any suggestions?  My syntax is as follows:

set db = dbengine.workspaces(0).opendatabase (d:\db.mdb)
set rs = db.openrecordset("Select * from printers, users where
printers.userid = users.userid")

After changes were made to the record...

rs.edit (this is where i get the error)
rs("users.userid") = xxxx etc.



Sun, 02 Jul 2000 03:00:00 GMT  
 Need to create recordset from 2+ tables with read/write

Have you tried using an explicit JOIN in your SQL instead of the
implied? Something like <SELECT * FROM printers INNER JOIN users ON
printers.userid = users.userid> I am not sure it will provide you with
any different recordset but it may. Also you might want to explicitly
specify that the recordset is a dynaset as in set rs =
db.openrecordset("Select * from printers, users where
printers.userid = users.userid", dbOpen Dynaset).

 On Wed, 14 Jan 1998 19:28:27 -0700, Brian Burkett

Quote:

>I am using vb50 and Access97 to create a small office inventory db.  I
>have multiple tables set up that represent printers, toner cartridges,
>users, etc.  They are all related by the appropriate printer id, toner
>id, etc.  If I create a recordset with fields from more that one table
>(which I must obviously do), I can't write changes to the multiple
>fields.  I get an error stating that the recordset was opened as
>read-only.  Any suggestions?  My syntax is as follows:

>set db = dbengine.workspaces(0).opendatabase (d:\db.mdb)
>set rs = db.openrecordset("Select * from printers, users where
>printers.userid = users.userid")

>After changes were made to the record...

>rs.edit (this is where i get the error)
>rs("users.userid") = xxxx etc.



Mon, 10 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need help opening Paradox tables for Read/Write

2. read write error when attempting to write to dbo_tblCounts (Access linked table)

3. Need Folder permissions Read Only / Program Access Read Write

4. Need to read sql2k table thru ado, need connection statement

5. HELP: Need help in creating a table from a table within Access

6. ADO Read-write parameter query recordsets

7. Read/Write recordsets from ADO command objects

8. Opening SQL Recordsets Read/Write

9. Recordset Reads Writes

10. Read/Write Recordsets from Stored Procedures

11. ADO: Read And Write Recordset with Command.Execute

12. ADO Read-write parameter query recordsets

 

 
Powered by phpBB® Forum Software