Security - DNS or DNSLess
Choosing which method to use depends on your hosting company.
First lets look at the typical structure of a hosting account.
Most hosts will have a setup that looks like the following:
Account-Root\
logs \
mydomain.com\
( where above mydomain.com is your public root - some hosts will name it differently)
database\
personal\
You are expected to place your database in the database directory and your Web files (index.html, main.html etc) in the mydomain.com directory.
IIS which comes with Windows 2003 has defaulted allow parent directories to off.
This is a security issue since this can allow script to access all directories if not set properly.
Some hosting companies will not change the default settings which limits a DNSLess connection to using the Web Root directory.
If this is the case for your hosting company then DNS is the best way to go else you must place the database within you Web root.
The safest place to place files for maximum security is in your account root!
DNS:
For a DNS connection you must setup an ODBC Data Source.
If your control panel allows this then you can set it up yourself else you must request it from your host support people.
Example:
strconn = "DSN=my-dataname"
Set dbc = Server.CreateObject("ADODB.Connection")
dbc.open strconn
DNSLess:
For a DNSLess connection you only need to set the connection string to the file location.
Example:
s_db_filename = "\database\my-database-filename"
s_db_path = Server.MapPath(s_db_filename)
strconn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & s_db_path
Set dbc = Server.CreateObject("ADODB.Connection")
dbc.open strconn
Vincent Gabriele