|
 |
asp_databases thread: How to reference an Access database on a web site
Message #1 by Rowenap@w... on Mon, 25 Sep 2000 14:10:41 +0100
|
|
-----Original Message-----
From: Simon Garstin [mailto:Sgarstin@t...]
Sent: 23 September 2000 23:48
To: support@w...
Subject: ASP2.0 with databases
Hi,
I have found the Wrox book Beginning ASP 2.0 very useful, however could
you
help me out with this problem.
In Chapt 13 it talks about the connection object in relation to connecting
with an Access database. On p413 it demonstrates assigning a DBQ value as
part of the variable strconnect.
The DBQ is listed as a path on a computer's C drive: ie.
"DBQ=C:\Inetpub\wwwroot\BegASP\Code\Contact.mdb".
The question is - how does one reference an Access database on a web site
in a similar way?
Sticking in "DBQ=http://www.anydomain.com/anydb.mdb" generates an asp
error
- I'm sure it's just a syntax problem, what is the correct way of doing
this ?
best regards
Simon Garstin
Message #2 by Imar Spaanjaars <Imar@S...> on Mon, 25 Sep 2000 18:17:37 +0200
|
|
Use the Server.MapPath function to translate a virtual path to a real path.
For instance Server.MapPath("/Database/myDB.mdb") could return
"C:\Inetpub\Database\myDB.mdb", depending on the actual location of the file.
Be aware however, that storing the DB inside the webroot is not a good
idea. Anyone knowing or guessing the name of the database could easily
download it.
So I think the preferred way is to store it somewhere where the user can't
get it, and then reference it with C:\Inetpub\Database\myDB.mdb or
something like that.
HtH
Imar
At 02:10 PM 9/25/2000 +0100, you wrote:
>-----Original Message-----
>From: Simon Garstin [mailto:Sgarstin@t...]
>Sent: 23 September 2000 23:48
>To: support@w...
>Subject: ASP2.0 with databases
>
>
>Hi,
>
>I have found the Wrox book Beginning ASP 2.0 very useful, however could
>you
>help me out with this problem.
>
>In Chapt 13 it talks about the connection object in relation to connecting
>with an Access database. On p413 it demonstrates assigning a DBQ value as
>part of the variable strconnect.
>
>The DBQ is listed as a path on a computer's C drive: ie.
>"DBQ=C:\Inetpub\wwwroot\BegASP\Code\Contact.mdb".
>
>The question is - how does one reference an Access database on a web site
>in a similar way?
>
>Sticking in "DBQ=http://www.anydomain.com/anydb.mdb" generates an asp
>error
>- I'm sure it's just a syntax problem, what is the correct way of doing
>this ?
>
>best regards
>
>Simon Garstin
>
>---
>To place your message here, or to sponsor this list, please e-mail
>mailto:p2pinfo@w...?subject=MediaPack, remembering to provide contact
>details for yourself. We will e-mail you a Media Pack within 24 hours.
>
>You are currently subscribed to asp_databases
>---
Message #3 by "Jason A. Greenfeld" <jgreenfeld@r...> on Mon, 25 Sep 2000 13:03:24 -0400
|
|
You could also use ODBC to create a DSN and access the DB that way.
Connection = "DSN=dbName","username","password"
ODBC is a little slower though.
Jason Greenfeld
Rubicon Technologies, Inc.
http://www.rubicontechnologies.com
-----Original Message-----
From: Imar Spaanjaars [mailto:Imar@S...]
Sent: Monday, September 25, 2000 12:18 PM
To: ASP Databases
Subject: [asp_databases] Re: How to reference an Access database on a
web site
Use the Server.MapPath function to translate a virtual path to a real path.
For instance Server.MapPath("/Database/myDB.mdb") could return
"C:\Inetpub\Database\myDB.mdb", depending on the actual location of the
file.
Be aware however, that storing the DB inside the webroot is not a good
idea. Anyone knowing or guessing the name of the database could easily
download it.
So I think the preferred way is to store it somewhere where the user can't
get it, and then reference it with C:\Inetpub\Database\myDB.mdb or
something like that.
HtH
Imar
At 02:10 PM 9/25/2000 +0100, you wrote:
>-----Original Message-----
>From: Simon Garstin [mailto:Sgarstin@t...]
>Sent: 23 September 2000 23:48
>To: support@w...
>Subject: ASP2.0 with databases
>
>
>Hi,
>
>I have found the Wrox book Beginning ASP 2.0 very useful, however could
>you
>help me out with this problem.
>
>In Chapt 13 it talks about the connection object in relation to connecting
>with an Access database. On p413 it demonstrates assigning a DBQ value as
>part of the variable strconnect.
>
>The DBQ is listed as a path on a computer's C drive: ie.
>"DBQ=C:\Inetpub\wwwroot\BegASP\Code\Contact.mdb".
>
>The question is - how does one reference an Access database on a web site
>in a similar way?
>
>Sticking in "DBQ=http://www.anydomain.com/anydb.mdb" generates an asp
>error
>- I'm sure it's just a syntax problem, what is the correct way of doing
>this ?
>
>best regards
>
>Simon Garstin
>
|
|
 |