/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Updating MSI using AutoIT scripting

03/06/2015 3190 views
Hello,

I am updating one MSI using autoit script. I have written Update SQL query but when I try to execute it, it fails on DB.OpenView(SQL Query) statement it says DB.^ requires object type variable. I have tried in vbscript as well it is working fine but not in AutoIT. Can anyone open help me on this.


1 Comment   [ + ] Show comment

Comments

  • Thanks for your reply, I have taken reference of above code but still same error at OpenView and there is no space between parentheses. Any other way to resolve my query.

All Answers

0
Is there really a space in the string between the parentheses or is that meant to be pseudo-code?
Answered 03/06/2015 by: VBScab
Red Belt

0
Have not worked with function yet in AutoIT, but here is some code I found on the AutoIT forum that may help.

;--------------------------- Get Tables --------------------------------------
$View = $DB.OpenView("SELECT `Name` FROM _Tables")
$View.Execute

$index = 1
While 1
$Rec = $View.Fetch
If Not IsObj($Rec) Then ExitLoop ; = Vbscript If Record Is Nothing

$sTable = $Rec.StringData(1)

If (StringLeft($sTable, 1) <> "_") Then ;-- Don't load _validation table. it's just a copy of all tables combined.
$TablesNames = GUICtrlCreateTreeViewitem($sTable, $Treeview)
GUICtrlSetImage (-1, "mmcndmgr.dll",-14) ; Negative index !!
GUICtrlSetColor(-1, 0x0000C0)
GUICtrlSetOnEvent($TablesNames,"TreeDBTableClick") ; Get TableData on Click

;--------------------------- Get Fields --------------------------------------
$ViewT = $DB.OpenView("SELECT `Name` FROM `_Columns` WHERE `Table` ='" & $sTable & "'")
$ViewT.Execute()
While 1
$RecT = $ViewT.Fetch
If Not IsObj($RecT) Then ExitLoop
$Fields = $RecT.FieldCount
For $i = 1 to $Fields
$TVdata = $TVData & $RecT.StringData($i)
Next
$TablesFields = GUICtrlCreateTreeViewitem($TVdata, $TablesNames)
$TVData = ""
WEnd
$ViewT.Close
EndIf
$index += 1
WEnd
$View.Close

Answered 03/06/2015 by: SMal.tmcc
Red Belt

  • Thanks for your reply, I have taken reference of above code but still same error at OpenView and there is no space between parentheses. Any other way to resolve my query.
0
Answered 03/09/2015 by: SMal.tmcc
Red Belt

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ