#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$dkdjkey="HKEY_CURRENT_USER\Software\jdlssoft\EPPortal"
$dkdjpath=RegRead($dkdjkey,"InstalledPath")
$dbdir = $dkdjpath &"\AppModules\GRSDS\Data.mdb"
$dbpwd = "GSDKDJV1200Jdls2008"
#Region ### START Koda GUI section ### Form=dkdj1.kxf
$Form1_1 = GUICreate("申报标志修改工具 for1.1", 327, 152, 329, 260)
$Label1 = GUICtrlCreateLabel("申报状态查询", 45, 28, 76, 20)
$Button1 = GUICtrlCreateButton("查 询", 200, 24, 75, 25, 0)
$Button2 = GUICtrlCreateButton("修 改", 200, 82, 75, 25, 0)
$Label2 = GUICtrlCreateLabel("申报标志修改", 45, 85, 76, 20)
$Group1 = GUICtrlCreateGroup("", 32, 5, 265, 113)
$cxrs=GUICtrlCreateInput("", 138, 27, 41, 21)
GUICtrlSetLimit(-1, 1)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label3 = GUICtrlCreateLabel("申报标志:0 可编辑;1 已发送,已导出,已打印", 38, 128, 256, 16)
$xgrs = GUICtrlCreateInput("", 138, 84, 40, 21)
GUICtrlSetLimit(-1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
cx()
Case $Button2
xg()
EndSwitch
WEnd
Func cx()
$Strn = GUICtrlRead($cxrs)
$addfld = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $dbdir & ";Jet Oledb:Database Password=" & $dbpwd)
$RS.ActiveConnection = $addfld
$jy = "select * from sbzb where sbbz= '" & $Strn & "'"
$RS.Open($jy)
EndFunc ;==>cx
今天刚开始学AUTOIT~有问题问各位大侠!