读书人

求小弟我看下段代嘛了

发布时间: 2013-09-05 16:02:06 作者: rapoo

求我看下段代嘛了.
Public Function ForwardRS(ssql As String, Optional Conn As Connection) As Recordset
Dim blNeedClose As Boolean

If Conn Is Nothing Then
Set Conn = New ADODB.Connection
Conn.CursorLocation = adUseClient
Conn.CommandTimeout = 300
Conn.Open connStr
blNeedClose = True
End If
If Conn.State <> adStateOpen Then Exit Function
Set ForwardRS = New ADODB.Recordset
ForwardRS.Open ssql, Conn, adOpenStatic, adLockReadOnly
If blNeedClose = True Then
ForwardRS.ActiveConnection = Nothing
Conn.Close
Set Conn = Nothing
End If
End Function
[解决办法]
就是 创建数据库对象 然后用游标读取数据吧。

读书人网 >VB Dotnet

热点推荐