Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open Recordset (VBA 6.3)

    Hey Gang,

    I inherited the following code:

    Set rst = New ADODB.Recordset
    Set rst.ActiveConnection = CurrentProject.Connection
    rst.CursorType = adOpenKeyset
    rst.LockType = adLockOptimistic
    rst.Source = "tblClosed"
    rst.Open options:=adCmdTable

    Set rstSource = New ADODB.Recordset
    Set rstSource.ActiveConnection = CurrentProject.Connection
    rstSource.CursorType = adOpenKeyset
    rstSource.LockType = adLockOptimistic
    rstSource.Source = "tblCaseFile"
    rstSource.Open options:=adCmdTable

    I am not sure what the options:=acCmdTable means. Can you explain? TIA.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Open Recordset (VBA 6.3)

    What is the host? I don't recognize the object "CurrentProject".

    adCmdTable (not acCmdTable) is one of several different ADO parameters that describe the nature of the command you are executing. It means you are supplying the name of a table to be opened.

    Other Examples:

    adCmdText means you are supplying a text string for a SQL query
    adCmdStoredProc means you are supplying the name of a stored procedure (SQL Server) or query (Jet/MDB) in the database

    Added: the command is supplied in the Source property in your code. In other code examples, you might see it as the first parameter in the Open method call.

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open Recordset (VBA 6.3)

    Thanks, that helps somewhat.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •