• Open Recordset (VBA 6.3)

    Author
    Topic
    #453770

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #1124861

      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.

    Viewing 0 reply threads
    Reply To: Open Recordset (VBA 6.3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: