#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 378, 190, -1, -1)
$ListView1 = GUICtrlCreateListView("姓名|证件号码|",8, 16, 361, 81)
$Label1 = GUICtrlCreateLabel("编号:", 24, 120, 76, 17)
$Input1 = GUICtrlCreateInput("", 104, 116, 249, 21)
GUICtrlSetLimit(-1, 18,18)
$Button1 = GUICtrlCreateButton("查询", 72, 152, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Serverip = IniRead("Member.ini", "SQLServer", "IP","")
$sqlpwd = IniRead("Member.ini", "SQLServer", "PWD","")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
if GUICtrlRead($Input1)<>'' Then
Dim $hardware = "cur_userdetail"
$conn = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$conn.Open("driver={SQL Server};server=" & $Serverip & ";uid=netcafe;pwd=" & $sqlpwd & ";database=local")
$RS.ActiveConnection = $conn
$RS.open("SELECT * FROM cur_userdetail where uniqueid = '" & GUICtrlRead ( $Input1 ) & "'")
While (Not $RS.eof And Not $RS.bof)
GUICtrlCreateListViewItem ( $RS.Fields (0).value&"|"& $RS.Fields (3).value,$ListView1 )
If StringIsDigit($RS.Fields(0).value)=0 Then
EndIf
ExitLoop
WEnd
$RS.close
Else
MsgBox(48,'错误','请输入编号查询!')
EndIf
EndSwitch
WEnd
没有找到相关数据,,该如何判断,,, 也就是这句 $RS.open("SELECT * FROM cur_userdetail where uniqueid = '" & GUICtrlRead ( $Input1 ) & "'") 查找失败后的返回值 ,怎么判断? |