找回密码
 加入
搜索
查看: 4698|回复: 4

[AU3基础] (已解决)关于读取数据库写入二维数组问题,凝问?

[复制链接]
发表于 2014-5-27 19:26:50 | 显示全部楼层 |阅读模式
本帖最后由 cfs43210 于 2014-5-28 22:56 编辑
Dim $cell_handle[1][32]
Dim $Count = 0

_SQLite_Open($SQLite_Data_Path)
_SQLite_Query(-1, "SELECT * FROM '" & $Theofficial & "' ORDER BY ZJXba DESC;", $hQuery)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK

        ReDim $cell_handle[$Count + 1][32]
        $cell_handle[$Count][0] = $aRow[0]
        $cell_handle[$Count][1] = $aRow[1]
        $cell_handle[$Count][2] = $aRow[2]
        $cell_handle[$Count][3] = $aRow[3]
        $cell_handle[$Count][4] = $aRow[4]
        $cell_handle[$Count][5] = $aRow[5]
        $cell_handle[$Count][6] = $aRow[6]
        $cell_handle[$Count][7] = $aRow[7]
        $cell_handle[$Count][8] = $aRow[8]
        $cell_handle[$Count][9] = $aRow[9]
        $cell_handle[$Count][10] = $aRow[10]
        $cell_handle[$Count][11] = $aRow[11]
        $cell_handle[$Count][12] = $aRow[12]
        $cell_handle[$Count][13] = $aRow[13]
        $cell_handle[$Count][14] = $aRow[14]
        $cell_handle[$Count][15] = $aRow[15]
        $cell_handle[$Count][16] = $aRow[16]
        $cell_handle[$Count][17] = $aRow[17]
        $cell_handle[$Count][18] = $aRow[18]
        $cell_handle[$Count][19] = $aRow[19]
        $cell_handle[$Count][20] = $aRow[20]
        $cell_handle[$Count][21] = $aRow[21]
        $cell_handle[$Count][22] = $aRow[22]
        $cell_handle[$Count][23] = $aRow[23]
        $cell_handle[$Count][24] = $aRow[24]
        $cell_handle[$Count][25] = $aRow[25]
        $cell_handle[$Count][26] = $aRow[26]
        $cell_handle[$Count][27] = $aRow[27]
        $cell_handle[$Count][28] = $aRow[28]
        $cell_handle[$Count][29] = $aRow[29]
        $cell_handle[$Count][30] = $aRow[30]
        $cell_handle[$Count][31] = $aRow[31]
        
        GUICtrlCreateListViewItem($cell_handle[$Count][21] & "|" & $cell_handle[$Count][0] & "|" & $cell_handle[$Count][1] & "|" & $cell_handle[$Count][3] & "|" & $cell_handle[$Count][4] & "|" & $cell_handle[$Count][6] & "|" & $cell_handle[$Count][2] & "|" & $cell_handle[$Count][5] & "|" & $cell_handle[$Count][8] & "|" & $cell_handle[$Count][7] & "|" & $cell_handle[$Count][12] & "|" & $cell_handle[$Count][14] & "|" & $cell_handle[$Count][15] & "|" & $cell_handle[$Count][16] & "|" & $cell_handle[$Count][17] & "|" & $cell_handle[$Count][18] & "|" & $cell_handle[$Count][19] & "|" & $cell_handle[$Count][20] & "|" & $cell_handle[$Count][22] & "|" & $cell_handle[$Count][23] & "|" & $cell_handle[$Count][24] & "|" & $cell_handle[$Count][26] & "|" & $cell_handle[$Count][27] & "|" & $cell_handle[$Count][25] & "|" & $cell_handle[$Count][31], $main_ListView1)
        $Count += 1
        
WEnd
_SQLite_Close()
不知道代码是否有问题,一万条数据写入二维数组,花时30分钟左右,实在有点受不了.请问有什么高效有方法.谢谢!
发表于 2014-5-27 21:51:54 | 显示全部楼层
_GUICtrlListView_AddArray  用此函数可以帮你解决!
 楼主| 发表于 2014-5-27 22:31:22 | 显示全部楼层
谢谢!不过我不是所有数据导出,这个用时还好,主要是写入二维数组时间过长。
发表于 2014-5-27 22:40:34 | 显示全部楼层
1w条数据存入数组不可能花费30分钟,不信你把GUICtrlCreateListViewItem注释了再试试
 楼主| 发表于 2014-5-28 22:55:47 | 显示全部楼层
找出原因了.原来是图片写入了数组.写入数组觉得跟数据库内容多少有关.谢谢!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 04:21 , Processed in 0.093192 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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