This topic is locked

Inline Edit Question

9/12/2008 11:06:32 PM
ASPRunnerPro General questions
M
mccreelake author

Hi,
I use ASPRunnerPro with MS Access. I was wondering if it was possible to have a view page with a certain set of data and then have the inline edit fields update a different set of data.
While the data would be from the same table, they would be from different queries in access. I ask this because I need to limit the records users can access by using some queries in access as well as the advanced security features (record ownership) in ASPRunner. However, the queries in access cause the data to become read-only. So, I want to use another query that contains the same fields minus the table that is controlling ownership (thus making the query writeable). I would need the records to update to the latter query rather than the first read-only one.
I did it today by creating a second edit page using the writeable query but wanted to know if there was a way to do it using inline edits as well.
I'm stuck. Please help.

M
myPCdoctor 9/13/2008

I may be out to lunch as I'm still relatively new at runner. But I had a similar circumstance so what I did was:

  1. Create a Customer View in runner. Give the appropriate users List access to this view and/or
  2. Modify your tables to use advanced seucrity, specifically User group permissions. See the help file.
    They can be used mutually or inclusively - at least I've got it working this way.
    Option 1 is nice and realtively easy. Also, you should set up User Level access on your tables based on something like Customer_ID or User_ID or setup a new field (I called mine User_LVL) and use it as a trigger mechanism for security.
    Option 2, is really cool. I've just started playing with it. But keep in mind that the other security options are also valid. In other words, they can work in conjuction with method #2. So you can really mix and match and get some fairly sohpisticated security schemas.
    I've found that when you use User Level permissios, make sure that you click on the User Id Number to select it THEN click on "Admin can...". This allows users the ability to access the tables based on your permission set(s), whilst someone with the Admin Level can do all kinds of things. It you miss the "Admin can.." nothing secure occurs.
    Finally (I tend to bable when I find neat things), I would consider implimenting multi-level security. For example, Users = 1, Editors = 5, Admins = 9. Then apply the permissions based on the User Level ID.
    I hope this helps, and please remember that I am new and still playing, but I'm having excellent success using the above.

Sergey Kornilov admin 9/14/2008

McCree Lake,
you can use BeforeEdit event to construct UPDATE query manually and update another table.
Do not forget to add BeforeEdit = false as the last line in BeforeEdit event.

M
mccreelake author 9/15/2008

Thanks for your help Sergey.
I have tried your instructions and running into a bit of a problem. When I try to edit the record via inline it is telling that it is read-only which means it is still trying to edit the read only query rather than the one specified in my SQL code.
Here is the code I am using (BeforeEdit) event. EventClientGAID is the primary key.

strSQLUpdate = "UPDATE GrpMng_Attnd_Evn_GrpAffAttn_Edit "

strSQLUpdate = strSQLUpdate & "SET Attendance = '" & inline("Attendance") & "',Notes = '" & inline("Notes") & "' "

strSQLUpdate = strSQLUpdate & "WHERE EventClientGAID = " & inline("EventClientGAID")

dbConnection.Execute strSQLUpdate
BeforeEdit = False
Sergey Kornilov admin 9/16/2008

Print your query on the web page and run it manually against your database to see what's wrong with it.

M
mccreelake author 9/17/2008

Thank you. Can you tell me how to print it on the web page? I am not sure how to do that. When you say test it manually against my database, do you mean from the ASPRunner application or in the database itself?
Thank you!

J
Jane 9/17/2008

To print query use Response.Write statement:

strSQLUpdate = "UPDATE GrpMng_Attnd_Evn_GrpAffAttn_Edit "

strSQLUpdate = strSQLUpdate & "SET Attendance = '" & dict("Attendance") & "',Notes = '" & dict("Notes") & "' "

strSQLUpdate = strSQLUpdate & "WHERE EventClientGAID = " & dict("EventClientGAID")

Response.Write strSQLUpdate



Then execute resulted query in the database directly.

M
mccreelake author 9/17/2008

Okay. I was able to figure it out. Thanks for your help! Now, my question is how to get users back to the master table once they have used inline edit to change the information. Since I am using BeforeEdit = False it updates that record, but it appears to the end user that nothing has happened. Is there a way, once record is save or the SAVE ALL button is pressed that the users can be directed back to the master table list and that I could refresh that page to show the changes?
Thanks! you guys are awesome.

J
Jane 9/18/2008

Hi,
unfortunately there is no easy way to redirect after Inline Edit.

Theoretically you can add custom JavaScript code (redirect and refresh page). However we don't have a ready to go solution for this.

M
mccreelake author 9/18/2008

Is there anyway to use the script with events that you use when the user clicks the cancel button on the table view page?

J
Jane 9/19/2008

Hi,
you need to use JavaScript code to redirect after Inline Edit.