RM Logo
Technical Rating: 
Support Home PageSupport
Print This PagePrint This Page
Add to 'My Library' Add to 'My Library'

Using a Microsoft Access database with RM Plesk web hosting
Published Date : 11 Mar 2008   Last Updated : 04 Oct 2024   Content Ref: TEC1088412  





Requirements

Access databases are only supported on those of our Microsoft® Windows® hosting packages which use the Plesk control panel. Our Linux web hosting and non-Plesk Windows web hosting packages do not support them.


Procedure

Uploading your database
  1. Log on to the Plesk control panel and go to File Manager.
    Note: Most website files are uploaded into the 'httpdocs' folder so that visitors to your website can access them. However, you do not want your database to be accessed directly by your visitors. Instead your web pages need to access it through scripting languages such as ASP. Therefore, you should upload your database file into the 'private' folder.
  2. Open the 'private' folder and click Upload Files.
  3. Click the Browse button and find your database (.mdb) file in the dialog which appears.
  4. Click the green OK button to upload it.

Setting up a database connection
  1. Return to the Home screen and open ODBC Data Sources.
  2. Click the Add New ODBC DSN button.
  3. On the screen which appears, enter a name (letters and numbers only, no spaces) for the connection to your newly uploaded database and (if you wish) a description.
  4. From the drop-down menu, select Microsoft Access Driver (*.mdb) and click the OK button.
  5. The only required field on the next page is Database File Path. This takes the following format:
    D:\inetpub\vhosts\<yourdomain.com>\private\<yourdatabasename.mdb>
    Therefore, if your domain is kesborough.sch.uk and your database is called website.mdb, the database file path should be: D:\inetpub\vhosts\kesborough.sch.uk\private\website.mdb. 
    Note: The domain part of the address does not include the www.
  6. You can normally ignore the remainder of the inputs.
  7. Finally, click the Test button to ensure that the connection has been set up correctly. You should see a Connection Successful message. If you do not see this message, there are several things to check:
    • Have you set the correct database file path? If your domain is www.school.sch.uk the path will not normally include the www.
    • Is your database password protected? If so, you may need to enter the appropriate username and password.


More Information

Database folder

We recommend that you put your database in the 'private' folder so that users to your website cannot download the MDB file. You can also put it in 'httpdocs' or a subfolder of 'httpdocs'
Note: If you do this, users will be able to download your MDB file.


Accessing your database via ASP

Now that you have created a DSN, you can use it to communicate with your database via an ASP or ASP.NET script (folder permissions will need setting first). In ASP, you can use code similar to the following:

Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DSN=<DSNName>;"

Replace <DSNName> with the connection name you entered above. You can now use your 'adoCon' object to communicate with your database.


Database path

All RM Plesk web servers are set up in the same way, so the database file path given above should work correctly. However, if you wish to confirm your file path you can do so as follows.

  1. Create a text file with the following content and name it path.asp:
    <html>
    <head></head>
    <body>
    <p>Path is:
    <%
    Response.Write Server.MapPath(Request.ServerVariables("PATH_INFO"))
    %>
    </p>
    </body>
    </html>
  2. Upload this file to the 'httpdocs' folder on your web space.
  3. Browse to this page via your web browser.
  4. You should see a file path something like the following:
    D:\inetpub\vhosts\yourdomain.com\httpdocs\path.asp
  5. To obtain the path to your database, simply take off the "httpdocs\path.asp" at the end and add "private\<your database file.mdb>", where <your database file.mdb> is the name of your Access MDB file.
  6. Finally, you should delete 'path.asp' from your site as you do not want casual visitors to your site to be able to see the file path information.


FEEDBACK
Did the information in this article help answer your question?
 Yes
 No
Please add any comments about this article in the box below. If you answered No then it is important you tell us why so that we can change the article if required. We can only respond if you log in to the RM Support website or provide your contact details. Note: If you need help with a technical query, please log a call online or telephone our support team.
Thank you for your feedback, which is sent directly to the RM Knowledge team. We address every message received with the intention of improving our Knowledge Library articles. If you have an unresolved technical issue, please contact RM Support.


If this article has not helped provide a solution then it is also possible to log a call...



Document Keywords: RM plesk, hosting, web, TEC1088412


Please read - important disclaimer information.
http://www.rm.com/_RMVirtual/Includes/csredirect.asp?cref=&title=Standard Content Disclaimer


Top Of PageTop of page