where does "129" mean in conn.execute sql, , 129
where does "129" mean in conn.execute sql, , 129
am 23.03.2005 06:48:39 von Janice
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?
Re: where does "129" mean in conn.execute sql, , 129
am 23.03.2005 07:09:07 von Chris Hohmann
"Jason Chan" wrote in message
news:es8M4v2LFHA.3380@TK2MSFTNGP15.phx.gbl...
>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/mdmthcnne xecute.asp
Re: where does "129" mean in conn.execute sql, , 129
am 23.03.2005 07:53:10 von Janice
Thanks Chris
"Chris Hohmann" ¦b¶l¥ó
news:uQJCU72LFHA.3356@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
> "Jason Chan" wrote in message
> news:es8M4v2LFHA.3380@TK2MSFTNGP15.phx.gbl...
> >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/mdmthcnne xecute.asp
>
>
Re: where does "129" mean in conn.execute sql, , 129
am 23.03.2005 11:35:47 von Ken Schaefer
Personally, I would suggest avoiding the use of "magic numbers"
Use of constants like adCmdText+adExecuteNoRecords would make your life much
easier.
Cheers
Ken
"Jason Chan" wrote in message
news:ecDw7T3LFHA.656@TK2MSFTNGP14.phx.gbl...
: Thanks Chris
: "Chris Hohmann" ¦b¶l¥ó
: news:uQJCU72LFHA.3356@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
: > "Jason Chan" wrote in message
: > news:es8M4v2LFHA.3380@TK2MSFTNGP15.phx.gbl...
: > >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/mdmthcnne xecute.asp
: >
: >
:
:
Re: where does "129" mean in conn.execute sql, , 129
am 23.03.2005 19:25:49 von Chris Hohmann
"Ken Schaefer" wrote in message
news:%23bEVxu4LFHA.1308@tk2msftngp13.phx.gbl...
> Personally, I would suggest avoiding the use of "magic numbers"
>
> Use of constants like adCmdText+adExecuteNoRecords would make your life
> much
> easier.
>
> Cheers
> Ken
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.