I'm assuming you don't have any "business logic" tier between your ASP code and your DB tier. You're fetching recordsets right out of the database from ASP, right?
The approved way to do this under the old ASP (before ASP.Net) rules was to use a System Data Source Name - at least for ODBC connections.
Then you specify the DSN in your ASP page connection strings. This keeps all of the connection and security information OUT OF your ASP code, and not even in an include file somebody might grab.
'Course the rules may differ under ASP.Net, and for other (non-ODBC) connections you can't have DSNs (use the ODBC Administrator in Control Panel for ODBC connections).
Can't imagine how you'd secure an OLEDB connection string except to wrap it in a component or else wrap all your ADO method calls, a pain in the rear.
I might make a simple VB component with one property:
Code:
DBString[\code]
All it needs to do is return a constant string, which should get the security info out of your ASP pages and your boss off your back.
Or if you wanted to get fancier you could create a method:
[code]DBString(strCode as String) as String
The method could do some simplistic "security" check before returning the connection string value, or the parameter might return different strings for different kinds of connections, so you don't need to make a hundred different methods to do this simple little thing.
There has to be a better answer though.
What you DON'T want to do is keep making new connections with different user/passwords for different clients. You'll break the connection pooling in IIS (so performance goes to crap) and you'll have weird effects like Bill's updates actually happen with Mary's user ID.
Your ASP pages
are the middle-tier, or at least
pretty middling. All the database connections should be done in the same database security context.
Don't push user authentication back onto the database server - you'll regret it.