Reloading a Database from a Visual Basic Script

If you want operators to reload the database from the iFIX WorkSpace, you can create a script to reload the database using a routine similar to the following:

Private Sub FixEvent1_OnTrue()

Dim load_pdb As String

Dim return_value As Double

Dim nodename As String

Dim database As String

 

nodename = "MIXER1"

database = "BACKUP"

load_pdb = System.ProjectPath + "\DBBLOAD" + " -N" + nodename + " -D" + database

return_value = Shell (load_pdb, 0)

End Sub

The -N command line parameter enables you to reload a database on a remote SCADA server. The -D command line parameter enables you to reload a database other than the currently loaded one. Both command line parameters are optional; if you do not use them, you reload the open database on the local SCADA server.

For information about using the Shell function from a script, see the Visual Basic help system.

CAUTION: The DBBLOAD system task does not prompt you to save changes to the database. Be sure you save your database before executing a script that reloads the database. Otherwise, you will lose all your changes.

 

See Also