#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$datename = @ScriptDir & "\data.mdb"
If not FileExists($datename) then Exit (Msgbox(16,'错误','未找到DATA.MDB文件,请检查文件名和路径'))
$datepass = "GSDKDJV1200Jdls2008"
#Region ### START Koda GUI section ### Form=申报信息查看工具.kxf
$Form1_1 = GUICreate("申报信息查看工具", 321, 232, 272, 151)
GUISetCursor (5)
$Label1 = GUICtrlCreateLabel("申报月份", 17, 19, 52, 17)
$Label2 = GUICtrlCreateLabel("扣缴义务人编码", 17, 167, 88, 17)
$Label3 = GUICtrlCreateLabel("企业名称", 17, 198, 52, 17)
$Label4 = GUICtrlCreateLabel("申报用户", 17, 50, 52, 17)
$Label5 = GUICtrlCreateLabel("申报时间", 17, 136, 52, 17)
$Label6 = GUICtrlCreateLabel("申报标志", 17, 79, 52, 17)
$Label7 = GUICtrlCreateLabel("申报反馈", 17, 108, 52, 17)
$Label8 = GUICtrlCreateLabel("扣款反馈", 188, 19, 52, 17)
$Label9 = GUICtrlCreateLabel("申报方式", 188, 50, 52, 17)
$Label10 = GUICtrlCreateLabel("反馈方式", 188, 79, 52, 17)
$Label11 = GUICtrlCreateLabel("申报类型", 188, 108, 52, 17)
$Label12 = GUICtrlCreateLabel("申报次数", 222, 136, 52, 17)
$Button1 = GUICtrlCreateButton("查 询", 140, 13, 43, 25, 0)
$kjywrbm = GUICtrlCreateInput("", 106, 165, 145, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$qymc = GUICtrlCreateInput("", 72, 195, 209, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sbfk = GUICtrlCreateInput("", 71, 104, 89, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sbcs = GUICtrlCreateInput("", 276, 133, 25, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sbsj = GUICtrlCreateInput("", 71, 133, 121, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sbbz = GUICtrlCreateInput("", 71, 75, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sbyh = GUICtrlCreateInput("", 71, 45, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sbfs = GUICtrlCreateInput("", 244, 45, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$kkfk = GUICtrlCreateInput("", 244, 16, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$fkfs = GUICtrlCreateInput("", 244, 75, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sblx = GUICtrlCreateInput("", 244, 104, 57, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$sbrq = GUICtrlCreateCombo("", 71, 16, 65, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
rq()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
cx()
EndSwitch
WEnd
Func rq()
$addfld = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datename & ";Jet Oledb:Database Password=" & $datepass)
$RS.ActiveConnection = $addfld
$jy = "select sbyf from sbzb"
$RS.Open($jy)
$data = ""
While (Not $RS.eof And Not $RS.bof)
$data &= $RS.Fields(0).value & "|"
$RS.movenext
WEnd
$RS.close
$addfld.Close
$temp = StringSplit($data, "|")
GUICtrlSetData($sbrq, $data, $temp[1])
EndFunc ;==>rq
Func cx()
Global $sbbz
$Strn = GUICtrlRead($sbrq)
$addfld = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datename & ";Jet Oledb:Database Password=" & $datepass)
$RS.ActiveConnection = $addfld
$jy = "select sbbz from sbzb where sbyf= '" & $Strn & "'"
$RS.Open($jy)
If $RS.eof And $RS.bof Then
MsgBox(16, "提示", "没有找到申报记录", 5)
GUICtrlSetData($sbbz, "")
ControlFocus("", "", $sbbz)
Else
Switch $RS.Fields(0).value
Case 0
GUICtrlSetData($sbbz, "未申报")
Case 1
GUICtrlSetData($sbbz, "已申报")
Case Else
GUICtrlSetData($sbbz, "未知状态")
EndSwitch
EndIf
$RS.close
$addfld.Close
EndFunc ;==>cx