QTP报错,请各位大侠看下
以下是我的QTP的脚本:
Dim Conn,Res,strsql,ydl
Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=OraOLEDB.Oracle.1;Password=wang;User ID=tp_nec_opr;Data Source=uatdb_22;Persist Security Info=False"
Conn.CommandTimeout = 300
Conn.Open
If Conn.State = 0 Then
Reporter.ReportEvent micFail, "testing", "连接数据库失败"
else
Reporter.ReportEvent micPass, "testing", "连接数据库成功"
Set Res = CreateObject("ADODB.Recordset")
strsql = "select * from ec_temp_base where apply_policy_no = '1000108000005475853';"
Res.Open strsql, Conn, 1, 3
ydl = Res("TEMP_ID")
msgbox ydl
End If
结果运行时报错:
ORA-00911:无效字符
Line(12):"Res.Open strsql, Conn, 1, 3"
请各位大侠帮忙看下,不胜感谢
[解决办法]
strsql = "select * from ec_temp_base where apply_policy_no = '1000108000005475853';"
把最后的;去掉试一下