18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

Interaction with the ActiveX control from <strong>VBScript</strong> is accomplished through <strong>VBScript</strong> code placed in a<br />

Screen Script that is associated with the screen where the ActiveX control is placed. By entering a right<br />

mouse click on a blank portion of the screen, and selecting Screen Script, the Screen Script is<br />

accessed. For ActiveX Objects placed on the screen, you do not need to instantiate the Object in<br />

<strong>VBScript</strong>, IWS has already taken care of this. You simply need to reference the ActiveX control by its<br />

name, found in the Object Properties dialog box. Note: when referring to the name from <strong>VBScript</strong>,<br />

the ActiveX control name is case sensitive <strong>for</strong> IWS versions 6.1 SP1 and earlier. From the<br />

<strong>VBScript</strong> screen interface, you can access the ActiveX control’s Properties and Methods. Events are<br />

not accessible from the <strong>VBScript</strong> Screen Script interface. The Active<br />

Key Notes:<br />

• You must use the <strong>VBScript</strong> Screen Script interface <strong>for</strong> the screen which contains the<br />

ActiveX control in order to access the ActiveX control’s Properties and Methods. You<br />

cannot access the ActiveX control’s Properties and Methods from another Screen<br />

Script, or from any other <strong>VBScript</strong> interface in IWS.<br />

• From <strong>VBScript</strong>, you can only access the ActiveX control’s Properties and Methods.<br />

<strong>VBScript</strong> code segments <strong>for</strong> Events that are triggered by the ActiveX control can be<br />

entered, but these <strong>VBScript</strong> code segments must be entered from the Configuration<br />

dialog box (i.e. Object Properties � Configuration � Events).<br />

• When the ActiveX control is referenced from the <strong>VBScript</strong> Screen Script interface, the<br />

ActiveX control’s name is case-sensitive <strong>for</strong> IWS version 6.1 SP1 and earlier.<br />

• You do not need to instantiate the ActiveX control. IWS has already taken care of this.<br />

Simply refer to the ActiveX control name followed by a “.” and then the Property or<br />

Method.<br />

• In the <strong>VBScript</strong> Screen Script interface, place the cursor in a code segment area<br />

(Subroutine) and press Ctrl –Space to invoke IntelliSense to see the <strong>VBScript</strong><br />

statements and functions, as well as the ActiveX controls available <strong>for</strong> this Script<br />

Interface.<br />

• Once you enter the ActiveX control object name, when you type a period (“.”),<br />

Intellisense will display a list of available Properties and Methods <strong>for</strong> the ActiveX<br />

control referenced.<br />

Additional in<strong>for</strong>mation on this topic is covered in the <strong>VBScript</strong> Configuration and Operation in IWS<br />

section later in this material.<br />

ActiveX Controls Instantiated from <strong>VBScript</strong><br />

ActiveX controls can be instantiated from <strong>VBScript</strong> by using the CreateObject and referencing the<br />

Program ID (ProgID) of the ActiveX object, although the ActiveX object will not show up on the IWS<br />

screen if the script segment is associated with a Screen.<br />

ADODB and ADOX Objects and Collections<br />

ADODB is the database wrapper <strong>for</strong> ADO.NET, or ActiveX Data Objects <strong>for</strong> Microsoft’s .NET<br />

Framework. ADO.NET is Microsoft’s database interface technology that provides an API to database<br />

client applications (i.e. IWS and <strong>VBScript</strong>), supporting a common interface to access and manipulate<br />

data contained in a wide variety of database servers from different vendors. From the database client<br />

side, there is a level of abstraction provided by the API that enables interaction (e.g. database access<br />

and manipulation) to various vendor’s databases with virtually no code changes, except <strong>for</strong> the<br />

40 <strong>InduSoft</strong>, Ltd.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!