Discussion Locked

Sorry if this is too newbie

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

But I've been a VB(3,5&6) client/server guy for years.

At my new gig we have some classic ASP that connets to a DB with connection objects. The Connection Strings are in the ASP code.

I've suggested moving them off into a Global.asa (there isn't one now) for security and to make life easier when moving from test to production and vice versa.

What is the best approach? Put the Connection objects and their connection strings in Global.asa or just keep the connection strings there and let the pages continue to create the Connection object while pulling info from Global.asa?

What scope should be used for the objects/variables in the "best" approach (session, page or application)?

I do know this page gets hit by many users so performance is a factor.

5 replies

by sjohnson175

After more research I decided to try session variables for the connection string.

Most research pointed to Application variables but I don't know if I have authority to restart an app and certainly can't reboot IIS as test and production share the same server (not my design).

So I have a Global.asa like this:

But I don't seem to be getting anything back when I reference Session("strConStr") in my ASP. It doesn't even come to me out of a Response.Write.

by jaqui

not sure about the asp part, but with php I would have a site wide cofiguration file that is used to include connection data, such as db sever, dbname, user name, password. this can be called by the query scripts, so that the data never actually get send to client machine.

the result set is sent, but not the connection data.

I've never worked with iis, so can't say how to get and use session variables with it.

but it would seem to be the session is started at a login, the session data can be either cookied or stored on the server. ( with apache and php at least )

so, to sum it up, go with the global.asa that sounfds like the closest asp will get to the way I would do it with php.

by sjohnson175

I'm closing this one down. Turns out the IIS server wasn't even configured with Applications.

It's working now and the team will discuss an implementation plan next week.

This discussion is closed to new replies.