VBA/Excel/Access/Word/Access/Recordset Support — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 12:46, 26 мая 2010

Does Recordset support Bookmark(adBookmark)

 
Sub SupportsMethod()
    "Declare and instantiate a Recordset object
    Dim rst As ADODB.Recordset
    Set rst = New ADODB.Recordset
    
    rst.ActiveConnection = CurrentProject.Connection
    rst.CursorType = adOpenStatic
    rst.LockType = adLockOptimistic
    rst.CursorLocation = adUseServer
    "Open the recordset, designating that the source
    "is a SQL statement
    rst.Open Source:="Select * from Employees ", _
        Options:=adCmdText
    "Determine whether the recordset supports certain features
    Debug.Print "Bookmark " & rst.Supports(adBookmark)
    Debug.Print "Update Batch " & rst.Supports(adUpdateBatch)
    Debug.Print "Move Previous " & rst.Supports(adMovePrevious)
    Debug.Print "Seek " & rst.Supports(adSeek)
    rst.Close
    Set rst = Nothing
End Sub



Does Recordset support Move Previous (adMovePrevious)

 
Sub SupportsMethod()
    "Declare and instantiate a Recordset object
    Dim rst As ADODB.Recordset
    Set rst = New ADODB.Recordset
    
    rst.ActiveConnection = CurrentProject.Connection
    rst.CursorType = adOpenStatic
    rst.LockType = adLockOptimistic
    rst.CursorLocation = adUseServer
    "Open the recordset, designating that the source
    "is a SQL statement
    rst.Open Source:="Select * from Employees ", _
        Options:=adCmdText
    "Determine whether the recordset supports certain features
    Debug.Print "Bookmark " & rst.Supports(adBookmark)
    Debug.Print "Update Batch " & rst.Supports(adUpdateBatch)
    Debug.Print "Move Previous " & rst.Supports(adMovePrevious)
    Debug.Print "Seek " & rst.Supports(adSeek)
    rst.Close
    Set rst = Nothing
End Sub



Does Recordset support Seek (adSeek)

 
Sub SupportsMethod()
    "Declare and instantiate a Recordset object
    Dim rst As ADODB.Recordset
    Set rst = New ADODB.Recordset
    
    rst.ActiveConnection = CurrentProject.Connection
    rst.CursorType = adOpenStatic
    rst.LockType = adLockOptimistic
    rst.CursorLocation = adUseServer
    "Open the recordset, designating that the source
    "is a SQL statement
    rst.Open Source:="Select * from Employees ", Options:=adCmdText
    "Determine whether the recordset supports certain features
    Debug.Print "Bookmark " & rst.Supports(adBookmark)
    Debug.Print "Update Batch " & rst.Supports(adUpdateBatch)
    Debug.Print "Move Previous " & rst.Supports(adMovePrevious)
    Debug.Print "Seek " & rst.Supports(adSeek)
    rst.Close
    Set rst = Nothing
End Sub



Does Recordset support Update Batch (adUpdateBatch)

 
Sub SupportsMethod()
    "Declare and instantiate a Recordset object
    Dim rst As ADODB.Recordset
    Set rst = New ADODB.Recordset
    
    rst.ActiveConnection = CurrentProject.Connection
    rst.CursorType = adOpenStatic
    rst.LockType = adLockOptimistic
    rst.CursorLocation = adUseServer
    "Open the recordset, designating that the source
    "is a SQL statement
    rst.Open Source:="Select * from Employees ", _
        Options:=adCmdText
    "Determine whether the recordset supports certain features
    Debug.Print "Bookmark " & rst.Supports(adBookmark)
    Debug.Print "Update Batch " & rst.Supports(adUpdateBatch)
    Debug.Print "Move Previous " & rst.Supports(adMovePrevious)
    Debug.Print "Seek " & rst.Supports(adSeek)
    rst.Close
    Set rst = Nothing
End Sub