RunSQLWizard Method Example

The following example initiates the SQL Wizard from a command button in the run-time environment. The command button configures the Data ObjectvxData1 to connect to the Microsoft Jet provider and an Access database. After setting the command type as an SQL Command, the example initiates the SQL Wizard. After you close the SQL Wizard, the example connects to the database and runs the query.

Private Sub CommandButton4_Click()

vxData1.DBDisconnect 

vxData1.OLEDBProvider = "Microsoft.Jet.OLEDB.3.51" 

vxData1.JetDB = "C:\Program Files (x86)\Proficy\iFIX\PDB\APPTest.MDB" 

vxData1.SourceType = vxSourceSQL 

vxData1.RunSQLWizard

vxData1.DBConnect 

End Sub

NOTES (CIMPLICITY USERS ONLY):

  • The name of the subroutine shown here follows standard VBA naming convention, which does not apply to CimEdit Basic script language.
  • In CIMPLICITY, the following additional code must precede the first reference of vxData1 in its scope:

Dim vxData1 As Object
Set vxData1 = CimGetScreen.Object.Objects.Item("vxData1").OleObject