'调用存储过程
Dim mycommand As ADODB.Command '命令
Dim mat_code As ADODB.Parameter '参数
Set mat_code = New ADODB.Parameter
Set mycommand = New ADODB.Command
mat_code.Type = adChar '参数类型
mat_code.Size = 9'参数长度
mat_code.Direction = adParamInput '参数方向,输入或输出
mat_code.Value = codeFrmGrid'参数的值
mycommand.Parameters.Append mat_code'加入参数
mycommand.ActiveConnection = Mydb '指定该command 的当前活动连接
mycommand.CommandText = "QuoteFrmMat" 'QuoteFrmMat 是要调用的存储过程名称
mycommand.CommandType = adCmdStoredProc ' 表明command 为存储过程
Set rs = New ADODB.Recordset
Set rs = mycommand.Execute()
With rs
If (.EOF And .BOF) Then
……………………对象关闭时,操作不被允许?
存储过程中是一个比较复杂的select