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

Heenan, Lambert Lambert.Heenan at AIG.com
Mon Jun 12 16:50:11 CDT 2006


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



More information about the AccessD mailing list