[求助]关于类模块的探讨
我编写了一个类模块,如下Public Function ExecuteSQL(ByVal SQL As String) As ADODB.Recordset
SQL = Trim(SQL)
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
Dim strAppPath As String
strAppPath = App.Path
If Right(strAppPath, 1) <> "\" Then
strAppPath = strAppPath & "\"
End If
strAppPath = strAppPath & "data\wx.mdb"
ConnectString = "DRIVER=Microsoft Access Driver (*.mdb);DSN=" & strAppPath & ";UID=;PWD="
rst.open
Set rst.activeconnection = cnn
rst.LockType = adLockOptimistic
rst.CursorType = adOpenKeyset
rst.open SQL
Set exesql = rst
Set rst = Nothing
Set cnn = Nothing
end function
但是运行时提示“用户定义类型未定义”的错误,本人不知应是如处进行添加,请懂得的给于帮忙,谢谢!