找回密码
 加入
搜索
查看: 8077|回复: 9

[AU3基础] 想直接从数据里获取姓名,如何写呢(已解决)

  [复制链接]
发表于 2014-7-26 07:53:39 | 显示全部楼层 |阅读模式
本帖最后由 qsy666888 于 2014-8-2 09:37 编辑

我想直接从数据库里获取每行的姓名,再在msgbox里显示出来,该如何写呢,请教大大们
代码附上:[code]#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)
发表于 2014-7-26 08:26:24 | 显示全部楼层
回复 1# qsy666888


  用的什么数据库? 直接用ADODB操作多方便....
 楼主| 发表于 2014-7-26 08:34:11 | 显示全部楼层
回复 2# austere
database
 楼主| 发表于 2014-7-26 15:37:19 | 显示全部楼层
没有人知道吗?
发表于 2014-7-26 19:20:30 | 显示全部楼层
                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[0] & @CRLF
                        WEnd
                        MsgBox(0, '全部人员', $sName)
回复 4# qsy666888
发表于 2014-7-27 01:29:59 | 显示全部楼层
回复 5# user3000


   楼上的好有钱啊。。。。羡慕
发表于 2014-7-27 12:49:28 | 显示全部楼层
回复 6# austere

同样膜拜一下大神
发表于 2014-7-29 16:38:36 | 显示全部楼层
膜拜一下大神
发表于 2014-7-29 19:25:30 | 显示全部楼层
楼主 应该多多支持开源,,,
 楼主| 发表于 2014-7-29 22:01:25 | 显示全部楼层
回复 9# au3x
源码不是放出来的吗
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-26 03:25 , Processed in 0.078609 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表