用户定义类型未定义 ??
Public Function executesql1(ByVal sql As String) As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim cmd As String
cmd = "provider=microsoft.jet.oledb.4.0;" & "data source=" & App.path & "\..\data\wrwtj.mdb;"
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
With cnn
.ConnectionString = cmd
.Open
End With
With rst
.Open sql, cnn, adOpenKeyset, adLockOptimistic
Set executesql1 = rst
End With
Set rst = Nothing
Set cnn = Nothing
End Function
我把这段代码放模块里边。。
为什么说第一句,用户定义类型未定义 ??