Updating MSI using AutoIT scripting
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.
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
-
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. - Viveks 9 years ago
Answers (3)
Please log in to answer
Posted by:
anonymous_9363
9 years ago
Posted by:
SMal.tmcc
9 years ago
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
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. - Viveks 9 years ago
Posted by:
SMal.tmcc
9 years ago
here is the link I got that from.
http://www.autoitscript.com/forum/topic/50375-msi-editor-a-database/
http://www.autoitscript.com/forum/topic/50375-msi-editor-a-database/