想直接从数据里获取姓名,如何写呢(已解决)
本帖最后由 qsy666888 于 2014-8-2 09:37 编辑我想直接从数据库里获取每行的姓名,再在msgbox里显示出来,该如何写呢,请教大大们
代码附上:#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
_SQLite_Startup ()
$SQLite_Data_Path = "SQLite.db"
$Tablekj = "kaojuan"
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("从数据库里获取姓名示例", 478, 412, 481, 210)
GUISetFont(11, 400, 0, "宋体")
Global $ListView1 = GUICtrlCreateListView("序号|姓名|语文", 8, 8, 458, 358)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func KC_lvdraw()
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView1))
Local $Irval, $Aresult, $Irows, $Icolumns
$Irval = _SQLite_GetTable2d( _SQLite_Open ($SQLite_Data_Path), "select rowid,* from kaojuan;" $Aresult, $Irows, $Icolumns)
_ArrayDelete($aresult, 0)
_GUICtrlListView_AddArray($ListView1, $Aresult) 回复 1# qsy666888
用的什么数据库? 直接用ADODB操作多方便.... 回复 2# austere
database 没有人知道吗? Case $Button1
Local $hQuery, $aRow, $sName = ''
_SQLite_Open($SQLite_Data_Path)
_SQLite_Query(-1, "SELECT * FROM " & $Tablekj & ";", $hQuery)
;Local $aNames
;_SQLite_FetchNames ($hQuery, $aNames)
;_ArrayDisplay($aNames)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
$sName &= $aRow & @CRLF
WEnd
MsgBox(0, '全部人员', $sName)回复 4# qsy666888 回复 5# user3000
楼上的好有钱啊。。。。羡慕 回复 6# austere
同样膜拜一下大神 膜拜一下大神 楼主 应该多多支持开源,,, 回复 9# au3x
源码不是放出来的吗
页:
[1]