社区
VB基础类
帖子详情
sql 中的返回值
chenxyon
2001-12-04 07:18:06
各为高手,如何在sql 中将储存过程中的返回值在VB中使用。
...全文
129
4
打赏
收藏
sql 中的返回值
各为高手,如何在sql 中将储存过程中的返回值在VB中使用。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hhbll_2001
2001-12-04
打赏
举报
回复
Dim cmd As New ADODB.Command
Dim ParamA As New ADODB.Parameter
ParamA.Type = adInteger
ParamA.Direction = adParamOutput '定义为输出参数
cmd.Parameters.Append ParamA
......
cmd.Execute
MsgBox ParamA.Value 'text1.text=parama.value
cqq_chen
2001-12-04
打赏
举报
回复
Dim cmd As New ADODB.Command
Set cmd.ActiveConnection = cn
With cmd
.CommandType = adCmdStoredProc
.CommandText = "Update_TPers"
.Parameters.Refresh
xh.Col = 2
xh.Row = 1
.Parameters("@FNumber") = xh.Text
.Parameters("@FNumber").Direction = adParamInput
xh.Col = 2
xh.Row = 2
.Parameters("@FName") = xh.Text
.Parameters("@FName").Direction = adParamInput
xh.Col = 2
xh.Row = 3
.Parameters("@FSex") = xh.Text
.Parameters("@FSex").Direction = adParamInput
xh.Col = 2
xh.Row = 4
.Parameters("@FBegDate") = xh.Text ' Format(xh.Text, "yyyy-mm-dd")
.Parameters("@FBegDate").Direction = adParamInput
xh.Col = 2
xh.Row = 5
.Parameters("@FDeprNumber") = xh.Text
.Parameters("@FDeprNumber").Direction = adParamInput
xh.Col = 2
xh.Row = 6
.Parameters("@FDeprName") = xh.Text
.Parameters("@FDeprName").Direction = adParamInput
xh.Col = 2
xh.Row = 7
.Parameters("@FZyName") = xh.Text
.Parameters("@FZyName").Direction = adParamInput
xh.Col = 2
xh.Row = 8
.Parameters("@FZbName") = xh.Text
.Parameters("@FZbName").Direction = adParamInput
xh.Col = 2
xh.Row = 9
.Parameters("@FXlName") = xh.Text
.Parameters("@FXlName").Direction = adParamInput
xh.Col = 2
xh.Row = 10
.Parameters("@FGbName") = xh.Text
.Parameters("@FGbName").Direction = adParamInput
xh.Col = 2
xh.Row = 11
.Parameters("@FHjName") = xh.Text
.Parameters("@FHjName").Direction = adParamInput
xh.Col = 2
xh.Row = 12
If xh.Text = "" Then
.Parameters("@FEndDate") = Null
.Parameters("@FEndDate").Direction = adParamInput
Else
.Parameters("@FEndDate") = Format(xh.Text, "yyyy-mm-dd")
.Parameters("@FEndDate").Direction = adParamInput
End If
xh.Col = 2
xh.Row = 13
.Parameters("@FZj") = xh.Text
.Parameters("@FZj").Direction = adParamInput
xh.Col = 2
xh.Row = 14
.Parameters("@FBank") = xh.Text
.Parameters("@FBank").Direction = adParamInput
xh.Col = 2
xh.Row = 15
.Parameters("@FQb") = xh.Text
.Parameters("@FQb").Direction = adParamInput
xh.Col = 2
xh.Row = 16
.Parameters("@FSj") = xh.Text
.Parameters("@FSj").Direction = adParamInput
xh.Col = 2
xh.Row = 17
.Parameters("@FKc") = xh.Text
.Parameters("@FKc").Direction = adParamInput
xh.Col = 2
xh.Row = 18
.Parameters("@FKj") = xh.Text
.Parameters("@FKj").Direction = adParamInput
xh.Col = 2
xh.Row = 19
.Parameters("@FKh") = xh.Text
.Parameters("@FKh").Direction = adParamInput
xh.Col = 2
xh.Row = 20
.Parameters("@FHtDate") = IIf(Len(xh.Text) = 0, Null, Format(xh.Text, "yyyy-mm-dd"))
.Parameters("@FHtDate").Direction = adParamInput
xh.Col = 2
xh.Row = 21
.Parameters("@FAddress") = xh.Text
.Parameters("@FAddress").Direction = adParamInput
xh.Col = 2
xh.Row = 22
.Parameters("@FBirthday") = IIf(Len(xh.Text) = 0, Null, Format(xh.Text, "yyyy-mm-dd"))
.Parameters("@FBirthday").Direction = adParamInput
xh.Col = 2
xh.Row = 23
.Parameters("@FNote") = xh.Text
.Parameters("@FNote").Direction = adParamInput
.Parameters("@FFull") = strFull
.Parameters("@FFull").Direction = adParamInput
.Execute
End With
Luke_cn
2001-12-04
打赏
举报
回复
用ADO的command 对象来调用存储过程,并且设置一变量来接收存储过程的返回值(如果有的话)。
wangchong
2001-12-04
打赏
举报
回复
什么意思???
mybatis
中
的
sql
语句的
返回值
本文详细解析了MyBatis框架
中
各种
SQL
语句(如select、insert、update、delete)的执行结果及异常处理机制。阐述了不同语句在成功执行时的
返回值
类型,以及在遇到数据库约束问题时的异常抛出情况。
SQL
中
获得EXEC后面的
sql
语句或者存储过程的
返回值
的方法
本文介绍在
SQL
中
如何通过EXEC执行动态
SQL
语句并获取
返回值
的方法,包括构造动态
SQL
及从存储过程
中
获取输出参数。
SQL
存储过程的几种
返回值
方法
本文详细介绍了
SQL
存储过程
中
的三种
返回值
方式:OUTPUT参数
返回值
、RETURN过程
返回值
及SELECT数据集
返回值
,并提供了具体实例说明如何实现这些
返回值
。
my
sql
动态
sql
返回值
_my
sql
存储过程 在动态
SQL
内获取
返回值
的方法详解
本文详细介绍了如何在My
SQL
存储过程
中
使用动态
SQL
来获取
返回值
,特别是涉及分页查询时,如何计算记录总数和总页数。通过示例展示了如何拼接和执行动态
SQL
,并将查询结果赋值给外部变量。
SQL
中
获得EXEC后面的
sql
语句或
返回值
的方法
本文介绍在
SQL
中
如何通过EXEC执行动态
SQL
语句并获取
返回值
的方法。包括将结果存储到变量
中
的具体步骤,以及调用带有输出参数的存储过程来获取
返回值
的实践。
VB基础类
7,787
社区成员
197,583
社区内容
发帖
与我相关
我的任务
VB基础类
VB 基础类
复制链接
扫一扫
分享
社区描述
VB 基础类
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章