Silly Question - SQL conn.execute

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • michaaal

    Silly Question - SQL conn.execute

    I feel a bit silly asking this because I use this code all the time, but
    what does the ",,129" mean? Are there other parameters that one might use
    (I only do fairly simple SQL commands).

    conn.execute strSQL,,129


  • Bob Barrows [MVP]

    #2
    Re: Silly Question - SQL conn.execute

    michaaal wrote:[color=blue]
    > I feel a bit silly asking this because I use this code all the time,
    > but what does the ",,129" mean? Are there other parameters that one
    > might use (I only do fairly simple SQL commands).
    >
    > conn.execute strSQL,,129[/color]

    The ADO online help can be found here:
    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


    There are two versions of the Execute command.
    The Command object's Execute method:
    command.Execute RecordsAffected , Parameters, Options

    and the Connection object's Execute method:
    connection.Exec ute CommandText, RecordsAffected , Options

    Notice that they both have an Options argument. This argument is " ... A
    Long value that indicates how the provider should evaluate the CommandText
    argument. Can be a bitmask of one or more CommandTypeEnum or
    ExecuteOptionEn um values."

    You can specify more than one value by adding them together. 129 is the
    combination of two values: 1 and 128.

    The 1 is enumerated by the adCmdText constant and tells the provider to
    treat the CommandText as a string containing a SQL statement. You should
    always provide the CommandType option - don't make the provider guess what
    the command type is: it wastes programming cycles and, in rare instances, it
    can make the wrong guess.

    The 128 is enumerated by adExecuteNoReco rds, and tells the provider not to
    construct a recordset object because the query being executed will not
    return any records.

    I will leave it up to you to look in the online help and find the other
    possible values allowed for the Options argument.

    HTH,
    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Comment

    • michaaal

      #3
      Re: Silly Question - SQL conn.execute

      You're the best, Bob.


      Comment

      Working...