Importing DLL
Posted by Mohammad Rahhal, Last modified by Diana Alkouni on 21 August 2020 01:32 PM

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.

Import DLL


Back to VTL Client Script Index

 

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions