本帖最后由 shenrenba 于 2010-9-9 17:13 编辑
RT, 帮我修改下代码 Msgbox显示的都对 就是控件中显示为空
-------------------------
用错函数了...
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <ButtonConstants.au3>
#include <GuiComboBoxEx.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$sqlpath = @ScriptDir & "\ceshi.db"
$sqlname = "ceshi"
_SQLite_Startup()
Local $hQuery, $aRow
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 442, 192, 124)
$Group1 = GUICtrlCreateGroup("Group1", 96, 48, 385, 209)
$Combo1 = _GUICtrlComboBox_Create($Form1, "", 160, 104, 249, 25, $CBS_DROPDOWN + $CBS_AUTOHSCROLL + $CBS_SIMPLE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
xs()
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func xs()
_SQLite_Open($sqlpath)
_SQLite_Exec(-1, "CREATE TABLE " & $sqlname & " (a,b,c);")
_SQLite_Exec(-1, "INSERT INTO " & $sqlname & " (a,b,c) VALUES ('c','2','World');")
_SQLite_Exec(-1, "INSERT INTO " & $sqlname & " (a,b,c) VALUES ('b','3',' ');")
_SQLite_Exec(-1, "INSERT INTO " & $sqlname & " (a,b,c) VALUES ('a','1','Hello');")
_SQLite_Query(-1, "SELECT * FROM " & $sqlname & " ORDER BY a DESC;", $hQuery)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
MsgBox(0, "", $aRow[0])
_GUICtrlComboBoxEx_BeginUpdate($Combo1)
_GUICtrlComboBox_AddString($Combo1, $aRow[0])
_GUICtrlComboBoxEx_EndUpdate($Combo1)
WEnd
_SQLite_Close()
EndFunc ;==>xs
|