Rabu, 08 Agustus 2012

RE: [MS_AccessPros] Option Compare Database

 

Clive,

Pardon me for jumping in but Option Explicit forces you to declare all
variables (have Dim statements). You can still have a Dim statement without
a datatype in which case the datatype defaults to Variant.

Glenn

<mailto:glenn@rgservices.ca> Description: signature block_OTM

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Clive
Sent: August-08-12 1:19 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Option Compare Database

Hi Connie,

To add to what John said, here is a good description
of 'Option Compare Database' from Microsoft,
http://support.microsoft.com/kb/98227

Option Explicit should be set in all modules. It
forces you define the DataType for all Dim statments
instead of allowing a default type.

Regards, Clive

--- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , mrsgoudge
<no_reply@...> wrote:
>
> John - So you would recommend adding "Option Compare Database" to each
module? That's not the default in vb?
>
>
>
> --- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , John Viescas <JohnV@>
wrote:
> >
> > Connie-
> >
> > Option Compare Database sets your code to use non-case sensitive
compares for
> > text (string). "A" = "a"
> >
> > That's what the query engine uses, and it's good to use that unless you
need a
> > case-sensitive compare. You can use the StrComp function to override the
> > default compare.
> >
> > John Viescas, author
> > Microsoft Office Access 2010 Inside Out
> > Microsoft Office Access 2007 Inside Out
> > Building Microsoft Access Applications
> > Microsoft Office Access 2003 Inside Out
> > SQL Queries for Mere Mortals
> > http://www.viescas.com/
> > (Paris, France)
> >
> >
> >
> >
> > -----Original Message-----
> > From: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> > [mailto:MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of mrsgoudge
> > Sent: Wednesday, August 08, 2012 5:30 PM
> > To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> > Subject: [MS_AccessPros] Option Compare Database
> >
> > Hi all,
> >
> > Midway through creating the database I made Option Explicit the default.
So I
> > was going to go back and add it too the initial modules. I've noticed
that some
> > modules have both Option Compare Database and Option Explicit.
> >
> > What does Option Compare Database mean? What determines if it should be
used?
> > Seems like some are recommending using it all the time. If so, should I
go back
> > and add it?
> >
> > Thanks!
> > Connie
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
>

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar