p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_forms thread: Database connection in an Include file


Message #1 by Nigel Parker <Nigel.Parker@c...> on Fri, 17 May 2002 12:53:20 +0100
Hi guys
Can anyone tell me how to set the connection string to a database
sitting on a webserver?
For example:
if an asp page has an include file which contains the connection string
why wont the page find the database when the database resides in 
the same folder as the calling file?

Calling File has include for db Connection:
<!-- #include file="dbConnection.asp" -->

dbConnection.asp file is as follows:
<%
	dim dbConn
	dbConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=???;Persist
Security Info=False;"
%>

Any ideas?

Thanks

Nigel
Message #2 by "Luca Nesti" <luca_nesti@h...> on Fri, 17 May 2002 15:44:20
Hi Nigel,
Use the full path c:\................
bye luca




> Hi guys
Can anyone tell me how to set the connection string to a database
sitting on a webserver?
For example:
if an asp page has an include file which contains the connection string
why wont the page find the database when the database resides in 
the same folder as the calling file?

Calling File has include for db Connection:
<!-- #include file="dbConnection.asp" -->

dbConnection.asp file is as follows:
<%
	dim dbConn
	dbConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=???;Persist
Security Info=False;"
%>

Any ideas?

Thanks

Nigel
Message #3 by "Peter Winning" <peter@i...> on Fri, 17 May 2002 15:40:26 +0100
Hi there
Try something like this

"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="&Server.Mappath("data.mdb");Persist
Security Info=False"

Regards
Peter

----- Original Message -----
From: "Nigel Parker" <Nigel.Parker@c...>
To: "ASP Forms" <asp_forms@p...>
Sent: Friday, May 17, 2002 12:53 PM
Subject: [asp_forms] Database connection in an Include file


> Hi guys
> Can anyone tell me how to set the connection string to a database
> sitting on a webserver?
> For example:
> if an asp page has an include file which contains the connection string
> why wont the page find the database when the database resides in
> the same folder as the calling file?
>
> Calling File has include for db Connection:
> <!-- #include file="dbConnection.asp" -->
>
> dbConnection.asp file is as follows:
> <%
> dim dbConn
> dbConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=???;Persist
> Security Info=False;"
> %>
>
> Any ideas?
>
> Thanks
>
> Nigel
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20


  Return to Index