Groups | Blog | Home
all groups > inetserver asp db > march 2005 >

inetserver asp db : where does '129' mean in conn.execute sql, , 129


Chris Hohmann
3/22/2005 10:09:07 PM
[quoted text, click to view]
The third parameter of the ConnectionExecute method is the options
parameter. Specifically, it represents a bitmask of the CommandType and
ExecutionOption values.

129 = 1 + 128

1 = adCmdText which indicates that the command is sql text versus say a
table name or a stored procedure name.
128 = adExecuteNoRecords which indicates that the command does not return
any records which is the case for DML statements such as
UPDATE/INSERT/DELETE.

Here's a link to the documentation for the Connection.Execute method:
http://msdn.microsoft.com/library/en-us/ado270/htm/mdmthcnnexecute.asp

Jason Chan
3/23/2005 12:00:00 AM
Thanks Chris
"Chris Hohmann" <nospam@thankyou.com> ¦b¶l¥ó
news:uQJCU72LFHA.3356@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
[quoted text, click to view]

Jason Chan
3/23/2005 12:00:00 AM
I read aspfaq, and saw almost all execute statement have options 129
i.e. conn.execute sql, , 129

But what does 129 mean in statment?
can I simple write conn.execute sql?

Chris Hohmann
3/23/2005 10:25:49 AM
[quoted text, click to view]

Point taken. However, the constant names could changes as well. To use
constants you have to either declare them yourself, include adovb.inc or use
a meta tag library reference. All of these options increase the memory
footprint of the page in question. Here's an article that discussing this
topic:
http://aspfaq.com/show.asp?id=2112

Of the four (4) options listed in the article, I like option three (3) which
is to place constant/value pairs in comments and use actual integer values
in the code. But each to his/her own.

Ken Schaefer
3/23/2005 8:35:47 PM
Personally, I would suggest avoiding the use of "magic numbers"

Use of constants like adCmdText+adExecuteNoRecords would make your life much
easier.

Cheers
Ken

[quoted text, click to view]
: Thanks Chris
: "Chris Hohmann" <nospam@thankyou.com> ¦b¶l¥ó
: news:uQJCU72LFHA.3356@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
[quoted text, click to view]
: > >I read aspfaq, and saw almost all execute statement have options 129
: > > i.e. conn.execute sql, , 129
: > >
: > > But what does 129 mean in statment?
: > > can I simple write conn.execute sql?
: > >
: > >
: > The third parameter of the ConnectionExecute method is the options
: > parameter. Specifically, it represents a bitmask of the CommandType and
: > ExecutionOption values.
: >
: > 129 = 1 + 128
: >
: > 1 = adCmdText which indicates that the command is sql text versus say a
: > table name or a stored procedure name.
: > 128 = adExecuteNoRecords which indicates that the command does not
return
: > any records which is the case for DML statements such as
: > UPDATE/INSERT/DELETE.
: >
: > Here's a link to the documentation for the Connection.Execute method:
: > http://msdn.microsoft.com/library/en-us/ado270/htm/mdmthcnnexecute.asp
: >
: >
:
:

AddThis Social Bookmark Button