Silly Question - SQL conn.execute

M

michaaal

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
 
B

Bob Barrows [MVP]

michaaal said:
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

The ADO online help can be found here:
http://msdn.microsoft.com/library/en-us/ado270/htm/dasdkadooverview.asp

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.Execute 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
ExecuteOptionEnum 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 adExecuteNoRecords, 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top