TA的每日心情 | 慵懒 2015-7-30 16:53 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
Dim Cnn,strSql
set Cnn = CreateObject("ADODB.Connection")
Cnn.ConnectionString="rovider=OraOLEDB.Oracle.1ersist Security Info=False;User ID=ibc_cassword=ecipower;Data Source=orcl"
Cnn.open
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
rs.open 执行完成后,不再执行后面的代码就退出了,查不出任何原因,求解决! |
|