Office中国论坛/Access中国论坛
标题:
如何连上这个对象
[打印本页]
作者:
mclly2000
时间:
2013-6-5 16:33
标题:
如何连上这个对象
本帖最后由 mclly2000 于 2013-6-5 16:35 编辑
<P>Public Sub Form_Load()
Dim CmdUntread As New ADODB.Command
Dim RsUntread As New ADODB.Recordset
Dim pUntread01 As ADODB.Parameter '定义参数
RsUntread.LockType = adLockOptimistic '定义锁的类型
RsUntread.CursorLocation = adUseClient '定义游标位置
RsUntread.CursorType = adOpenKeyset '定义游标类型
CmdUntread.ActiveConnection = NetDS '激活连接
CmdUntread.CommandText = "proc_HeaveyPerson_ReplyUntreadCaseMsg @CaseNumber=?"
Set pUntread01 = CmdUntread.CreateParameter(Type:=adVarChar, Size:=30) '创建参数类型及大小
CmdUntread.Parameters.Append pUntread01 '参数输入存储过程
CmdUntread.Parameters(0) = "C342500VEH13000986" '定义参数的值为用户名
CmdUntread.Execute
RsUntread.Open CmdUntread
Set Me.Recordset = RsUntread '将ADO记录集赋值给子窗体
Me.Refresh
RsUntread.ActiveConnection = Nothing‘关闭链接</P>
<P>end sub
</P>
复制代码
如何连上这个RsUntread记录集
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3