Importing DLL
VTL Script allows users to import Dlls (COM DLL) by using CreateObject Function.
Sample
Public Sub main()
Dim Connection
Dim Recordset
Dim SQL
'declare the SQL statement that will query the database
SQL = "SELECT * FROM Test"
'create an instance of the ADO connection and recordset objects
Set Connection = CreateObject("ADODB.Connection")
Set Recordset = CreateObject("ADODB.Recordset")
'open the connection to the database
Connection.Open "DSN=Examples_dsn"
'Open the recordset object executing the SQL statement and return records
Recordset.Open SQL,Connection
'first of all determine whether there are any records
Dim vEOF
vEof = Recordset.EOF
If vEof Then
AlertMessage "No records returned."
Else
'if there are records then loop through the fields
Do While NOT vEof
AlertMessage Recordset("row")
AlertMessage Recordset("row2")
Recordset.MoveNext()
Loop
End If
'close the connection and recordset objects freeing up resources
Recordset.Close
Set Recordset=nothing
Connection.Close
Set Connection=nothing
End Sub
When attaching the script the below window will appear to alert users about all DLLs that are used inside the script, to run the script you should allow DLL imports else the script will not run.

Back to VTL Client Script Index
|