|
Access Databases
Your hosting account includes the ability
to run Access database(s) as part of your
site - your account includes a /private
folder which cannot be viewed directly from
the web and should be used to store your
Access database file(s).
Access as a web site back end database
Access databases work very well for most
web sites where there will not be a large
number of concurrent visitors, however if
you are expecting large volumes of traffic
to your site you may consider upgrading
to an SQL Server 2000 / 2005 database. SQL Server
is a true enterprise quality database and
will handle the largest and busiest of web
site back ends. SQL Server databases can
be ordered from your MyDotNetted
account.
Connecting to your Access
database
Ole db dsnless connection
(recommended)
Our recommended method of connecting to
your Access database(s) is via an ole db
connection string, this is the
fastest and most efficient way to connect
your scripts to your database. The connection
string you need to use is as follows :
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\websites\localuser\*username*\private\*database*"
(The string should all be on one line with
a space between 'Data' and 'Source')
e.g. If your username were jonsmith and
your database called jonsmith.mdb the full
string would be :
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\websites\localuser\jonsmith\private\jonsmith.mdb"
(The string should all be on one line with
a space between 'Data' and 'Source')
ODBC dsnless connection
An alternative to the ole db connection
is to connect to your database using a dsnless
ODBC connection, this isn't as efficient
as as ole db and is not recommended but
is more 'forgiving' with regards to reserved
names etc. - if you're having problems with
syntax errors or similar in your pages using
the ole db connection then changing to the
following connection string may solve your
problems :
"Driver={Microsoft Access Driver (*.mdb)};
DBQ=D:\websites\localuser\*username*\private\*database*"
(The string should all be on one line with
a space between ';' and 'DBQ')
e.g. If your username were jonsmith and
your database called jonsmith.mdb the full
string would be :
"Driver={Microsoft Access Driver (*.mdb)};
DBQ=D:\websites\localuser\jonsmith\private\jonsmith.mdb"
(The string should all be on one line with
a space between ';' and 'DBQ')
DSN
If required we can also set up a DSN for
your database connection - a DSN allows
you to call the database from your scripts
just by calling the DSN in your connection
string rather than the entire database path.
The disadvantage is that DSN's are considerably
less efficient than an ole db connection,
will cause your scripts to run more slowly
and place a higher load on the server.
If you need us to create a DSN for you
please log into your MyDotNetted
account and complete the request form.
Finding the path to your files
The path shown above is the correct absolute
path to your 'private' directory, however
if you ever need to check an absolute path
on our (or any other Windows based) server
run the following script on the server :
<%=Server.MapPath("/")%>
The script will return the full path to
itself.
|