请教各位一个问题 环境如下
(1) 我在sql server 上建立一个 存储过程 VB_Xlstyl1
(2) 客户端用 VB+ADO 调用 VB_Xlstyl1,然后在VB中显示字段 rtstyl (3) 但VB出现了如下错误 :
实时错误 '3265' :
在对应所需名称或序数的集合中,未找到项目。(4) 如果在存储过程加上一句 ,"set nocount on", vb程序就可以正常运行. 如果我有很多个 存储过程,是否每个都要加上 "set nocount on" ,是否有简单的方法解决这个问题
(1) 设置 ADO 的属性可以吗?
(2) 设置 SQL SERVER 的属性可以吗?
(3) 还有其他简单的方法吗?
附 :
create proc VB_Xlstyl1 as
Declare @BBB table (tstyl char(16),tcont int) Insert @BBB (tstyl,tcont)
select xsstyl,count(*) from xlstyle
where xsstyl <> '' group by xsstyl having count(*) >1 select rtstyl=xsstyl from xlstyle where xsstyl <> '' and xspric is null
Go
(1) 我在sql server 上建立一个 存储过程 VB_Xlstyl1
(2) 客户端用 VB+ADO 调用 VB_Xlstyl1,然后在VB中显示字段 rtstyl (3) 但VB出现了如下错误 :
实时错误 '3265' :
在对应所需名称或序数的集合中,未找到项目。(4) 如果在存储过程加上一句 ,"set nocount on", vb程序就可以正常运行. 如果我有很多个 存储过程,是否每个都要加上 "set nocount on" ,是否有简单的方法解决这个问题
(1) 设置 ADO 的属性可以吗?
(2) 设置 SQL SERVER 的属性可以吗?
(3) 还有其他简单的方法吗?
附 :
create proc VB_Xlstyl1 as
Declare @BBB table (tstyl char(16),tcont int) Insert @BBB (tstyl,tcont)
select xsstyl,count(*) from xlstyle
where xsstyl <> '' group by xsstyl having count(*) >1 select rtstyl=xsstyl from xlstyle where xsstyl <> '' and xspric is null
Go
解决方案 »
- 如何写个程序把Int,Double等数据类型的取值范围求出来
- 新手,工资计算公式,错误?为什么?小时候数学没学好,我哭啊!
- 求教WebBrowser1自动点击弹出框的问题
- 为什么VB调用EXECL速度很慢
- 模块变量 传递给 DataReport1 中的 label???
- VB连接SQL数据库,高手帮帮忙,在线等,谢谢
- 请问怎么作像word一样的可拖动、可吸附到顶上的工具条,再线等待
- 在线等待:easy的问题,点击网页的一个连接,想动态连接不同的url,该怎么写htm..
- 怎么屏蔽右键菜单??在线等待。
- 请问在ado控件中sql语句的模糊查询为什么得不到正确结果?
- 年关已到,救命啊,小弟跪求!。。。。。。。有分贡上!!!
- 工程发布后,安装在98上。但没有DCOM。怎办?
(2) 客户端用 VB+ADO 调用 VB_Xlstyl1,然后在VB中显示字段 rtstyl (3) 但VB出现了如下错误 :
实时错误 '3265' :
在对应所需名称或序数的集合中,未找到项目。//似呼是因为返回了多个记录集,可能是Rst只记得了最后的一个.而你调用的是哪个字段?可能是Rst得到了你的最后一个Select
(4) 如果在存储过程加上一句 ,"set nocount on", vb程序就可以正常运行. 因为是记数的,可能是加上这句则呼略Insert和Select rtsty1=...这些,只顺记录集.
Set nocount on
如果我有很多个 存储过程,是否每个都要加上 "set nocount on" ,//一般的存储过程是什么样的?会存在返回多个记录集的情况吗?我写存储过程一般是不用加的
是否有简单的方法解决这个问题
(1) 设置 ADO 的属性可以吗?
(2) 设置 SQL SERVER 的属性可以吗?
(3) 还有其他简单的方法吗?//似呼是不可以.
附 :
create proc VB_Xlstyl1 as
Declare @BBB table (tstyl char(16),tcont int) Insert @BBB (tstyl,tcont)
select xsstyl,count(*) from xlstyle
where xsstyl <> '' group by xsstyl having count(*) >1 select rtstyl=xsstyl from xlstyle where xsstyl <> '' and xspric is null
Go