标准用法是 还有,fuction打错了,应打为Function public function GetRecordset(m_connection as adodb.connection,strSql as string) as adodb.recordset dim rs as new recordset with rs set.activeconnection=m_connection .coursortype=adopenkeyset ... .open strSql,,,,adcmdtext end with set GetRecordset=rs end function
是啊,不许要先定义一个Rs,自定义函数的用法就是这样的。 就像 Public Function Love(Who as String) As String If Who="女" Then Love="我爱你" Else Love="你好!" End If End Function 一样,直接使用函数名,绝对是正确的。
set GetRecordset=new adodb.recordset 你这条语句是创建一个数据集对象 thinkeasy(Nothing)的说法很有意义,我又学到新知识了呵呵
还有,fuction打错了,应打为Function
public function GetRecordset(m_connection as adodb.connection,strSql as string) as adodb.recordset
dim rs as new recordset
with rs
set.activeconnection=m_connection
.coursortype=adopenkeyset
...
.open strSql,,,,adcmdtext
end with
set GetRecordset=rs
end function
就像
Public Function Love(Who as String) As String
If Who="女" Then
Love="我爱你"
Else
Love="你好!"
End If
End Function
一样,直接使用函数名,绝对是正确的。
你这条语句是创建一个数据集对象
thinkeasy(Nothing)的说法很有意义,我又学到新知识了呵呵