I am developing a vb.net application that uses an MS-Access database that has a password.
When the application first starts up I ask the user for the password for the database. It uses that password to connect to the database to verify the password provided was correct. All is well.....
Then they open a form, which opens another form, which creates an object, that needs data from the database where eventualy a database connection object needs to be created for that business object. Well, the password for the database is known by the form several layers back....
Is there a better way of getting the database password into the data access object (where it is actually needed) other than passing it around from form to form, object to object, until it is actually used?
This is not a web enabled application, so there is no "session" object to set the password variable on. But basically I think what I need is some sort of "global" object that the entire application can access, so all objects can see what the database password is if they need to.
When the application first starts up I ask the user for the password for the database. It uses that password to connect to the database to verify the password provided was correct. All is well.....
Then they open a form, which opens another form, which creates an object, that needs data from the database where eventualy a database connection object needs to be created for that business object. Well, the password for the database is known by the form several layers back....
Is there a better way of getting the database password into the data access object (where it is actually needed) other than passing it around from form to form, object to object, until it is actually used?
This is not a web enabled application, so there is no "session" object to set the password variable on. But basically I think what I need is some sort of "global" object that the entire application can access, so all objects can see what the database password is if they need to.