Reference this class in scripts through the Database class. You can create an instance of the object class and connect to a database using following script excerpt:
<script language="VBScript" src="ZTIUtility.vbs"/> <script language="VBScript" src="ZTIDataAccess.vbs"/>
<script language="VBScript">
Dim oDatabase
Dim oRecordset
Set oDatabase = new Database
oDatabase.SQLServer ="NYC-MDT-01"
oDatabase.Instance ="SQLExpress"
oDatabase.Database ="MDTDB"
oDatabase.Port = ""
oDatabase.Netlib ="DBNMPNTW"
oDatabase.Table ="ComputerSettings"
oDatabase.Parameters ="UUID, AssetTag, SerialNumber, MacAddress"
oDatabase.ParameterCondition = "OR"
oDatabase.SQLShare ="DeploymentShare$"
oDatabase.Connect
Set oRecordset = oDatabase.Query
WScript.Echo "Records retrieved: " & oRecordset.RecordCount
Related Topics