M
Mota
Hello;
I have to Edit and Update a Table,accessed thru an Inner Join SQL (If it
helps,no matter inner join or left join or right join,for two tables are
joined by a one-to-one relationship havin referrential integrity for both
update and delete).My code is this:
Dim DB As Database, Rs As DAO.Recordset, StrSql As String
Set DB = DBEngine(0)(0)
StrSql = "select drugsTBL.*,OrdersTBL.* from drugsTBL inner join OrdersTBL "
StrSql = StrSql & "on DrugsTBL.DId=OrdersTBL.DId where DrugsTBL.Did=5"
Set Rs = DB.OpenRecordset(StrSql, 2)
With Rs
..Edit
!Order = "Take one Each 6 Hours"
..Update ' The line raises Error "Can not update.DB Object is ReadOnly"
End With
Rs.Close
For some reasons,i need to keep it as a Sql statement, and avoid from
converting it to a stored query.
Is there a trick to do such an Edit?
Thank you in advance.
I have to Edit and Update a Table,accessed thru an Inner Join SQL (If it
helps,no matter inner join or left join or right join,for two tables are
joined by a one-to-one relationship havin referrential integrity for both
update and delete).My code is this:
Dim DB As Database, Rs As DAO.Recordset, StrSql As String
Set DB = DBEngine(0)(0)
StrSql = "select drugsTBL.*,OrdersTBL.* from drugsTBL inner join OrdersTBL "
StrSql = StrSql & "on DrugsTBL.DId=OrdersTBL.DId where DrugsTBL.Did=5"
Set Rs = DB.OpenRecordset(StrSql, 2)
With Rs
..Edit
!Order = "Take one Each 6 Hours"
..Update ' The line raises Error "Can not update.DB Object is ReadOnly"
End With
Rs.Close
For some reasons,i need to keep it as a Sql statement, and avoid from
converting it to a stored query.
Is there a trick to do such an Edit?
Thank you in advance.