error updating a recordset using an inner join - please help 
Author Message
 error updating a recordset using an inner join - please help

Can any one help, I am trying to update two tables using an inner join.
Each time I changed my sql statement to not include the join the update
works fine, but i get the following error when I use the inner join sql
statement.

Error: Cannot Update. Database or object is read only.

The only thing that I can figure is since I am joining the contactid and
categoryid then searching for a contactid with a certain value, it then
returns the recordset back as read only.  I am not sure can some one help.

If there is a better way of doing this please let me know.  I am using an
access97 database and ADO 2.x.

Thanks in advance.
Jorge

sql = "Select tbl_mainlist.*,tbl_categories.* from " & _
              "tbl_mainlist inner join tbl_categories on
tbl_mainlist.contactid " & _
              "= tbl_categories.categoryid where tbl_mainlist.contactid=" &
_
              frmContact.txt_ContactId.Text

' conn is an open connection already established
rsUpdate.Open sql, conn, adOpenDynamic, adLockOptimistic



Wed, 19 Feb 2003 04:11:31 GMT  
 error updating a recordset using an inner join - please help

In a Wrox book call DataBase Beginning ... it is mention that not all
query's are
updateable.
Sometimes you need to make many query's in order to have the job done.

Yves


Quote:
> Can any one help, I am trying to update two tables using an inner join.
> Each time I changed my sql statement to not include the join the update
> works fine, but i get the following error when I use the inner join sql
> statement.

> Error: Cannot Update. Database or object is read only.

> The only thing that I can figure is since I am joining the contactid and
> categoryid then searching for a contactid with a certain value, it then
> returns the recordset back as read only.  I am not sure can some one help.

> If there is a better way of doing this please let me know.  I am using an
> access97 database and ADO 2.x.

> Thanks in advance.
> Jorge

> sql = "Select tbl_mainlist.*,tbl_categories.* from " & _
>               "tbl_mainlist inner join tbl_categories on
> tbl_mainlist.contactid " & _
>               "= tbl_categories.categoryid where tbl_mainlist.contactid="
&
> _
>               frmContact.txt_ContactId.Text

> ' conn is an open connection already established
> rsUpdate.Open sql, conn, adOpenDynamic, adLockOptimistic



Thu, 27 Feb 2003 13:58:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SELECT . INNER JOIN--INNER JOIN

2. Update without using inner join

3. Using ADO recordsets in an inner join

4. Using ado recordset in an SQL Server inner join

5. !how VB update Table A INNER JOIN Table B, Set A.co=B.ID

6. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

7. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

8. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

9. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

10. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

11. how VB update Table A INNER JOIN Table B, Set A.co=B.ID

12. !how VB update Table A INNER JOIN Table B, Set A.co=B.ID

 

 
Powered by phpBB® Forum Software