|
- What types of database do you support?
Currently MS Access 2000, MySQL (via Helm) and MSSQL 2008 (not via Helm).
- How do I connect to my Access database with ASP ?
You can use a system or a DSN-less connection.
DSN-less connections are faster than System DSN connections because DSN-less avoids
doing a registry lookup. Furthermore you can receive additional performance benefits
by directly using the OLEDB layer.
Here is an example:
Dim Conn, dbPath
dbPath = "F:\Domains\yourdomain.suffix\db\YourDatabase.mdb" Set Conn = Server.CreateObject("ADODB.Connection") 'Using OLEDB (fastest but some SQL features may be unavailable) Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath 'Using the MS Access driver (faster than a DSN) 'Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbPath
To find the correct path to use above, please create a web page using the following
script on your website and then navigate to it using your browser, this will show
you the servers disk path to the root folder of your website, you then need to amend
this path to point to the location of your database (e.g. if you keep your database
within the 'data\mydatabase' folder in your site root you will need to remove the
'db' and add 'wwwroot\data\mydatabase\yourdatabase.mdb' instead).
<HTML><HEAD></HEAD><BODY> <% Dim strPath Response.write(Server.MapPath("\"))
%> </BODY></HTML>
- Which directory should I put my database in?
Any directory can be used as long as your connection strings points to the right
place. You are advised to upload your database files to the 'db'
directory. This is a more secure place to put them than within the 'wwwroot' as
in this directory they are not accessible by any surfers who may find the URL to
your database by chance and be able to download all your stored information.
|