If Cnn.state=0 Then
Reporter.ReportEvent micFail,"testing","数据库连接失败"
else
Reporter.ReportEvent micPass,"testing","数据库连接成功"
End If
if Cnn.State<> 0 then
Set Rs=CreateObject("ADODB.Recordset")
strsql ="select * from blc_gp_head where GATEPASS_NO='ZN2010120000000208' "
'set rs=Cnn.execute(sql)
Rs.Open strsql ,Cnn,1,1
msgbox(RS.Recordcount)
ydl=Rs("GATEPASS_NO")
msgbox ydl
dim a
a="ZN2010120000000208"
for i=1 to Rs.Recordcount
if Rs("GATEPASS_NO")=a then
msgbox "a在数据库中存在"
exit for
else
Rs.MoveNext
end if
next
end if
RS.close
Set RS=nothing
Cnn.Close
Set Cnn=nothing