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.
Please log in to comment

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

Please log in to comment
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.
Please log in to comment
0
Answered 03/09/2015 by: SMal.tmcc
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity