I’m working on a project where we need to run a batch file (on the gateway server) on demand from the clients.
The batch file takes care of some database housekeeping (namely copying MS Access database tables into MySQL for use in reporting), and we would like to have a simple “refresh” button that executes this batch file on the gateway.
Using the designer (a designer running on the gateway) I succesfully added a script on mouse click to a button component. The script code is simple:
A quick switch to preview mode and a click of the button does indeed cause the batch file to run, and I have verified that the data is indeed copied from the MS Access database to the MySQL database. However, what we really need is for that script to always execute on the gateway server and not on client hardware. The idea was to use a button that toggles a tag, causing a gateway script to execute using the same code.
The problem I’m having is that I can’t seem to get the same script to work within a gateway script triggered on tag change. I have a Gateway Event Script (Tag Change) set up to trigger on a SQLTag, and the script that is slated to execute is the exact same script in the code box above. Changing the trigger tag doesn’t cause any updating to occur within the MySQL database, as it did with the button script.
I feel like I’m missing some kind of obvious syntax thing here, but can’t find much help searching the forums or the help literature.