Update

<< Click to Display Table of Contents >>

 

Update

To update an existing record on the table, users must use the Update command. The record to change is the selected one. To return the value of fields from an E3Browser, use the GetColumnValue method.

1.Insert on the Screen a Query object and name it as "UpdateQuery".

2.On the SQL tab, enable direct edition and change the existing command.

UPDATE ConfigDevice
  SET Port = <%Port%>, IP = '<%IP%>'
  WHERE Device = '<%Device%>'

 

3.We want to update the selected row in the E3Browser. To return the value of a row in an E3Browser, create the next script on this object's DblClick event.

Screen.Item("spDevice").Value = GetColumnValue(0)
Screen.Item("spPort").Value = GetColumnValue(1)
Screen.Item("spIP").Value = GetColumnValue(2)

 

4.In the Update button, add the next script on the Click event.

'UPDATE
Screen.Item("UpdateQuery").SetVariableValue _
  "Device", Screen.Item("spDevice").Value
Screen.Item("UpdateQuery").SetVariableValue _
  "IP", Screen.Item("spIP").Value
Screen.Item("UpdateQuery").SetVariableValue _
  "Port", Screen.Item("spPort").Value
Screen.Item("UpdateQuery").Execute(True)

 

5.Execute the application and test this new functionality.

Was this page useful?