Dim res As Recordset
Set rst = New ADODB.Recordset
Set rst = LoadInfoIntoRest("Access", screenID)
If rst.EOF = True Then Else
s = rst!name
End If然后在模块里写
Public Function LoadInfoIntoRest(strProcedurename As String, strscreenID As String) As Recordset
Set cmd = New ADODB.Command
With cmd
.CommandType = adCmdStoredProc
.CommandText = strProcedurename 'store procedure name
.ActiveConnection = CN
End With
Set LoadInfoIntoRest = cmd.Execute
Exit Function出错,好象recerdset不能当函数返回值,怎么弄法?
Set rst = New ADODB.Recordset
Set rst = LoadInfoIntoRest("Access", screenID)
If rst.EOF = True Then Else
s = rst!name
End If然后在模块里写
Public Function LoadInfoIntoRest(strProcedurename As String, strscreenID As String) As Recordset
Set cmd = New ADODB.Command
With cmd
.CommandType = adCmdStoredProc
.CommandText = strProcedurename 'store procedure name
.ActiveConnection = CN
End With
Set LoadInfoIntoRest = cmd.Execute
Exit Function出错,好象recerdset不能当函数返回值,怎么弄法?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货