qtp中得到的数据集总数与DB运行结果总数不一致
本帖最后由 wangjuan_gm 于 2015-1-9 11:57 编辑qtp的print窗口,显示的rec.fields.count结果是6,但是将print窗口的sql语句复制到DB运行,实际只有1条
代码如下:
Set rac=createobject("adodb.recordset")
sub_his="select csh.num_history_id, csh.num_client_id,csh.num_service_id, csh.vc2_service_conf_code, csh.dat_subscribe_time, csh.dat_marketing_timefrom CRM_SUBSCRIBE_HISTORIES csh where csh.num_client_id in('"&sht.cells(2,11)&")"
rac.Open sub_his,Cnn
print rac.Fields.Count
print sub_his
If not rac.EOF Then
rac.MoveFirst
For i=1 to rac.Fields.Count-1
P4="历史ID--"& rac.Fields.Item("num_history_id").Value &";客户ID--"&rac.Fields.Item("num_client_id").Value &";业务--- "&rac.Fields.Item("vc2_service_conf_code").Value &";订购时间"&rac.Fields.Item("dat_subscribe_time").Value &";创建时间"&rac.Fields.Item("dat_marketing_time").Value
sht.cells(11,i+1)=P4
bak5=bak5 &"'"& rac.Fields.Item("num_history_id").Value &"',"
rac.MoveNext
Next
sht.cells(2,14)=mid(bak5,1,len(bak5)-1)
print bak5
else
sht.cells(11,2)=""
sht.cells(11,2)="订购历史表无信息"
End If
rac.Close
Set rac=nothing
运行结果截图如下:
print窗口截图如下:
DB运行截图如下:
页:
[1]