davidkirchner
MIS
Global.asa has:
Sub Application_OnStart
Set CWconn = CreateObject("ADODB.Connection"
CWconn.ConnectionString = "uid=user;pwd=pass;DSN=CivilWar;"
CWconn.Open
Application("CivilWarConn" = CWconn
And my asp pages use this:
<%@ LANGUAGE="JAVASCRIPT" %>
<%
var recordSet = Server.CreateObject("ADODB.RecordSet"
var CWconnection = Application("CivilWarConn"
and I use the connection later like this:
recordSet.Open(sql,CWconnection);
but some days the CWconnection is "undefined". Is a constant connection "thru Application_OnStart and closed in Application_OnEnd" a bad practice?
If this practice is OK, what is a good error solution?
if((""+CWconnection ) == "undefined" {reconnect}
Instead of hand coding the solution function in every page... Can I create a solution function in global.asa? Do I just make an include file with the solution and call the include from every asp page? Any good suggestions out there?
David Kirchner
davidkirchner@yahoo.com
Sub Application_OnStart
Set CWconn = CreateObject("ADODB.Connection"
CWconn.ConnectionString = "uid=user;pwd=pass;DSN=CivilWar;"
CWconn.Open
Application("CivilWarConn" = CWconn
And my asp pages use this:
<%@ LANGUAGE="JAVASCRIPT" %>
<%
var recordSet = Server.CreateObject("ADODB.RecordSet"
var CWconnection = Application("CivilWarConn"
and I use the connection later like this:
recordSet.Open(sql,CWconnection);
but some days the CWconnection is "undefined". Is a constant connection "thru Application_OnStart and closed in Application_OnEnd" a bad practice?
If this practice is OK, what is a good error solution?
if((""+CWconnection ) == "undefined" {reconnect}
Instead of hand coding the solution function in every page... Can I create a solution function in global.asa? Do I just make an include file with the solution and call the include from every asp page? Any good suggestions out there?
David Kirchner
davidkirchner@yahoo.com