This topic is locked

add/edit record in a view

4/24/2008 9:37:02 PM
ASPRunnerPro General questions
Y
yairilan author

Hi.

I've build a VIEW based on a table in the MSSQL and in I can't add/edit a record.after I click SAVE I get this message:

<<< Record was NOT edited >>>

View or function 'riklama.Bowlby_View_Tbl_Tipulim_Rakazim' is not updatable because the modification affects multiple base tables


In the MSSQL I can add or change a record, is it possible to do it in ASPRunner?
Tx very much,

yair

J
Jane 4/25/2008

Hi,
unfortunately you can't update fields from different tables on the edit/add pages.
As workaround update fields from another table in the Before record added/updated event and remove it from main SQL query.

Here is a sample:

'update anothertablename

strUpdate = "update AnotherTableName set Field1='" & dict("Field1") & "', Field2='" & dict("Field2") & "' where KeyField=" & dict("KeyField")

dbConnection.Execute strUpdate
'remove fields from main SQL query

dict.remove("Field1")

dict.remove("Field2")

Y
yairilan author 4/25/2008

Tx Jane,

What do you mean by "'remove fields from main SQL query" - what this action will do to the original table?

J
Jane 4/28/2008

Hi,
"remove fields from main SQL query" means that joined fields are removed from update query.