Re: Cursor Constants
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Apr 2006 21:22:42 -0400
ASP doesn't let you include libraries like you can in, say, Access. That
means you have to define the named constants if you want to be able to use
them in your code.
You don't have to: you can use prst.Open psql, pcon, 3, 3 if you want to,
but are you going to remember what those values mean when you go back to
look at the code in a month?
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"DanjoMan" <DanjoMan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6E145636-B0F2-428F-8062-0D34FC1DCA9B@xxxxxxxxxxxxxxxx
That makes sense what you are saying for example:
prst.Open psql, pcon, adOpenStatic, adLockOptimistic
But that leads me back to wondering why ever display this in your code at
the top of the .asp page?
const adOpenStatic = 3
const adLockOptimistic = 3
const adLockReadOnly = 1
const adCmdText = 1
Lastly, if for example adOpenStatic is ALWAYS 3 then it would not take
very
long to memorize that..
But anyway.. seems that then write out the cursors in your connection
opening and forget about declaring constants?
Thank you very much.
"Douglas J. Steele" wrote:
No, you couldn't have set them to any numeric values. Those are the
actual
values that the ADO library uses.
I'm not sure I understand your comment that "he did not USE them ... he
still typed out the cursor names". If you mean he used adOpenStatic
rather
than 3 and adLockOptimistic rather than 3, that's the whole point of
having
named constants. It's far easier to look at the OpenRecordset command
with
named constants and figure out what's supposed to be happening than
looking
at one with numeric values used instead.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"DanjoMan" <DanjoMan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:200A3EF6-3472-4DA6-A1E0-7EC1E229F1C1@xxxxxxxxxxxxxxxx
HI.
What rules or logic define what numerals are given to cursor constants?
For example:
const adOpenStatic = 3
const adLockOptimistic = 3
const adCmdText = 1
Could these have been set to ANY numeral?
Secondly, I noticed that the constants were set in the code by the
previous
programmer but he did not USE them, that doesn't make sense on his
connection
in the sql string he still typed out the cursor names.. so I am just
trying
to come full circle in understanding so I am using the #'s.
.
- References:
- Re: Cursor Constants
- From: Douglas J. Steele
- Re: Cursor Constants
- Prev by Date: Re: random function
- Next by Date: Query update table
- Previous by thread: Re: Cursor Constants
- Next by thread: Re: Updating A CrossTab Query?
- Index(es):
Relevant Pages
|