lhy6456210 发表于 2011-3-27 23:11:45

用AU3如何实现读取ACC数据库的记录

就是想实现把ACC上的数据库的所有记录写到上面的GUI上面,如果UDF能做到,尽量用UDF,代码可以很多,但是要让我好理解,因为是新手;
ACC数据库如下:


AU3 的GUI如下:


代码如下:#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
#Include <GuiImageList.au3>
#Include <GuiStatusBar.au3>
#include <Access.au3>
$aero = @ScriptDir &"\qq2009.she"
$skin = @scriptdir&"\Skin.dll"
Skin($aero)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("客户资料", 800, 600, 192, 114)
GUISetState(@SW_SHOW)
GUICtrlCreateGroup("保山网维大师客户资料",0,10,800,500)
GUICtrlCreateLabel("查找网吧:",20,550)
GUICtrlCreateInput("",80,548,80,20)
GUICtrlCreateButton("搜索",180,548)
GUICtrlCreateButton ("添加数据库",240,548)
$listview1=GUICtrlCreateListView ("网吧ID|网吧名称|网吧IP地址|网维大师VIP序号|网吧联系人|网吧联系电话|网吧地址|网吧技术负责人",0,30,800,500,-1,0x00000001)
$name=GUICtrlCreateContextMenu($listview1)
GUICtrlCreateMenuItem("查找网吧",$name)
GUICtrlCreateMenuItem("添加数据",$name)
GUICtrlCreateMenuItem("删除数据库",$name)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 0)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 150)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
Func Skin($She)
      $Dll = DllOpen($skin)
      DllCall($Dll, "int", "SkinH_AttachEx", "str",$She, "str", "benkel")
      DllCall($Dll, "int", "SkinH_SetAero", "int", 0)
EndFunc   ;==>Skin

nmgwddj 发表于 2011-3-27 23:20:03

{:face (88):} 帮助文档-论坛自定义函数-Access

xxoojoeooxx 发表于 2011-3-27 23:29:03

http://www.autoitx.com/forum.php?mod=viewthread&tid=21635&extra=page%3D4%26amp%3Borderby%3Ddateline%26amp%3Bfilter%3D2592000里的Read_Data()函数可以看看
UDF 我没用过

lizhou 发表于 2011-3-29 11:26:14

请教,数据库加密你怎么读?

auto 发表于 2011-3-29 19:38:36

查询后将结果写到相关的界面就可以了
可以参考论坛的相关例子。。。通信录等

guland 发表于 2011-3-30 08:08:48

回复 1# lhy6456210


    论坛里面有很多例子的,给你一个别人写的例子,相信你能看懂

http://www.autoitx.com/forum.php?mod=viewthread&tid=873&highlight=%CA%FD%BE%DD%BF%E2
页: [1]
查看完整版本: 用AU3如何实现读取ACC数据库的记录