Recordset 对象的 Open 方法可打开存储过程吗 5
代码如下,其中$RS.open中的字符串经测试是正确能够查询的,连接也是正常的,运行程序报错的是While(Not$RS.eoforNot$RS.bof);和$RS.Fi...
代码如下,其中 $RS.open中的字符串经测试是正确能够查询的,连接也是正常的,运行程序报错的是While (Not $RS.eof or Not $RS.bof); 和$RS.Fields (1).value这两个地方,是存储过程不能用还是怎么
$Conn= ObjCreate("ADODB.Connection") $Conn.open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DyResearch;") $Conn.Execute("USE DyResearch") $RS=ObjCreate("ADODB.Recordset") $RS.ActiveConnection=$Conn $RS.open (" execute query_data '"&$r2&"' , '"&$time&"','"&$codetype&"','"&$code&"'") While (Not $RS.eof or Not $RS.bof); GuiCtrlCreateListViewItem($RS.Fields (0).value&'|'&$RS.Fields (1).value&'|'&$RS.Fields (2).value&'|'&$RS.Fields (3).value&'|'&$RS.Fields (4).value&'|'&$RS.Fields (5).value&'|'&$RS.Fields (6).value&'|'&$RS.Fields (7).value&'|'&$RS.Fields (8).value&'|'&$RS.Fields (9).value&'|'&$RS.Fields (10).value&'|'&$RS.Fields (11).value, $ListView_sql) $RS.movenext;下一笔资料 WEnd;结束循环读表 $RS.close;
$Conn.close 展开
$Conn= ObjCreate("ADODB.Connection") $Conn.open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DyResearch;") $Conn.Execute("USE DyResearch") $RS=ObjCreate("ADODB.Recordset") $RS.ActiveConnection=$Conn $RS.open (" execute query_data '"&$r2&"' , '"&$time&"','"&$codetype&"','"&$code&"'") While (Not $RS.eof or Not $RS.bof); GuiCtrlCreateListViewItem($RS.Fields (0).value&'|'&$RS.Fields (1).value&'|'&$RS.Fields (2).value&'|'&$RS.Fields (3).value&'|'&$RS.Fields (4).value&'|'&$RS.Fields (5).value&'|'&$RS.Fields (6).value&'|'&$RS.Fields (7).value&'|'&$RS.Fields (8).value&'|'&$RS.Fields (9).value&'|'&$RS.Fields (10).value&'|'&$RS.Fields (11).value, $ListView_sql) $RS.movenext;下一笔资料 WEnd;结束循环读表 $RS.close;
$Conn.close 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询