Global.asa

S

SAC

In using vbscript, what's the syntax for pointing to the db connection
that's made in the global.asa? Do I use it like I would using a system dsn?

Normally I've used a system dsn and used:
rsName.ActiveConnection = "dsn=(dsnName)"

But I don't know how to use the global.asa connection info.

Thanks.
 
K

Kevin Spencer

The global.asa file is just a script with different Application-level event
handlers in it. Usually, a Connection String is cached in the Application
Collection. So, either look for one there, or put one there.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
S

SAC

Here's the Application_OnStart event in my global.asa that FP made when I
imported an Access db:

Sub Application_OnStart
'==FrontPage Generated - startspan==
Dim FrontPage_UrlVars(1)
'--Project Data Connection
Application("Hubbell_ConnectionString") = "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=URL=HubbellWeb_Data.mdb"
FrontPage_UrlVars(0) = "Hubbell_ConnectionString"
Application("Hubbell_ConnectionTimeout") = 15
Application("Hubbell_CommandTimeout") = 30
Application("Hubbell_CursorLocation") = 3
Application("Hubbell_RuntimeUserName") = ""
Application("Hubbell_RuntimePassword") = ""
'--
Application("FrontPage_UrlVars") = FrontPage_UrlVars
'==FrontPage Generated - endspan==
End Sub

Would "Hubbell_ConnectionString" be the Connection String?

If not, where is the Application Collection?

Thanks.
 
S

Stefan B Rusynko

Dim Conn_Name
Conn_Name = Application("Hubbell_ConnectionString")
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Conn_Name


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Here's the Application_OnStart event in my global.asa that FP made when I
| imported an Access db:
|
| Sub Application_OnStart
| '==FrontPage Generated - startspan==
| Dim FrontPage_UrlVars(1)
| '--Project Data Connection
| Application("Hubbell_ConnectionString") = "DRIVER={Microsoft Access Driver
| (*.mdb)};DBQ=URL=HubbellWeb_Data.mdb"
| FrontPage_UrlVars(0) = "Hubbell_ConnectionString"
| Application("Hubbell_ConnectionTimeout") = 15
| Application("Hubbell_CommandTimeout") = 30
| Application("Hubbell_CursorLocation") = 3
| Application("Hubbell_RuntimeUserName") = ""
| Application("Hubbell_RuntimePassword") = ""
| '--
| Application("FrontPage_UrlVars") = FrontPage_UrlVars
| '==FrontPage Generated - endspan==
| End Sub
|
| Would "Hubbell_ConnectionString" be the Connection String?
|
| If not, where is the Application Collection?
|
| Thanks.
|
|
|
|
| | > The global.asa file is just a script with different Application-level
| event
| > handlers in it. Usually, a Connection String is cached in the Application
| > Collection. So, either look for one there, or put one there.
| >
| > --
| > HTH,
| >
| > Kevin Spencer
| > Microsoft MVP
| > .Net Developer
| > A watched clock never boils.
| >
| > | > > In using vbscript, what's the syntax for pointing to the db connection
| > > that's made in the global.asa? Do I use it like I would using a system
| > > dsn?
| > >
| > > Normally I've used a system dsn and used:
| > > rsName.ActiveConnection = "dsn=(dsnName)"
| > >
| > > But I don't know how to use the global.asa connection info.
| > >
| > > Thanks.
| > >
| > >
| > >
| >
| >
|
|
 
K

Kevin Spencer

Yup. Any reference to Application("SomeString") is a reference to a member
added to the Application Collection. It can be used to get or to set that
member.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
S

SAC

Thanks!

Kevin Spencer said:
Yup. Any reference to Application("SomeString") is a reference to a member
added to the Application Collection. It can be used to get or to set that
member.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top