[AccessD] Class Rebuttal was: Basic Unbound Form ...

DWUTKA at marlow.com DWUTKA at marlow.com
Mon Jun 12 19:30:00 CDT 2006


Huh?  So you either constantly read the ini file by creating a new instance
of the class, or you set the class as a global variable, and it only reads
it when it's first initiated.  Why reread the ini file over and over?

Drew

-----Original Message-----
From: Heenan, Lambert [mailto:Lambert.Heenan at aig.com]
Sent: Monday, June 12, 2006 4:50 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Class Rebuttal was: Basic Unbound Form ...


What's unclean about a class member reading the INI file and storing the
connection string. Serving it all to the application when it needs it?

MyConnectionStirng = globStrConnectionString

Vs.

MyConnectionString = MyClass.ConnectionString


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Monday, June 12, 2006 5:39 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Class Rebuttal was: Basic Unbound Form ...


On 12 Jun 2006 at 16:17, Josh McFarlane wrote:

> I'd be interested in seeing this instance where an unprotected global 
> variable has to exist.
> 

Not has to, but is simplest.

In many of my VB apps which connect to an SQL Server, I store connection 
details in an ini file (we can discuss ini files v registry at some other 
time <g>).   On startup, I read the ini file and built a global connection 
string which I use in ADO recordsets throughout the application.

Sure, the string *could* be modified anywhere in the application, but there 
is absolutely no reason to and it is a much cleaner solution that any of 
the alternatives.


 

-- 
Stuart


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list