Cloud Service >> Knowledgebase >> Plesk >> How do you connect a Microsoft Access Database(MDB) to Windows Plesk?
submit query

Cut Hosting Costs! Submit Query Today!

How do you connect a Microsoft Access Database(MDB) to Windows Plesk?

Microsoft Access is a database management tool through which you can design and maintain a database locally on your computers. However, there may be circumstances where you want to link a web app or the website hosted on a Windows server having Plesk to an Access database –. mdb or. accdb file.

Here, I'll describe how to connect the Microsoft Access database to a website or web application on a Windows server with Plesk.

Prerequisites:

- A server operating on Windows and has a control panel known as Plesk.

- Microsoft Access database file in Microsoft Office, either in the older version of Microsoft Access 2002 or 2003, mdb format, or the newer version, Office 2007 and 2010, in. accdb format.

- Any given website or web application that wants to interact with the Access database.

Steps:

1. Upload the Microsoft Access Database File to Your Server

Firstly, to use the Access database on your website, you will need to host the Database on your server, which can be in. mdb or. accdb format. You can achieve this with an FTP application or the File Manager option located in the Plesk interface.

Once uploaded, note the full path to the database file on the server (e. g. , C:

Welcome To Iinetpub\vhosts\your-domain: \r\n\r\nThis site is not operated by the owners of the INET-Publish domain name, but rather is hosted by one of the sites located inside this domain.\r\n\r\nNot all of the sites related to the internet domain INET-Publish.com are owned by the domain name's owners, INET-P com\httpdocs\database\mydb. mdb).

2. Create a Data Source Name (DSN)

On this level, a Data Source Name (DSN) stores the necessary connection data to a database. A DSN for the Access database must be created on the Windows server.

If everything is 'right,' in sequence, open the ODBC Data Source Administrator on your server (use the search function on the Start menu to find the 'ODBC' option). Click on the "TradeFlow_Mart_Active" button, switch to the "System DSN" tab, and then click the "Add . . ." button in the ODBC Data Source Administrator window.

In the pop-up window that opens, click the "Create new data source" button, then select the "Microsoft Access Driver (*. mdb, *. accdb)" and click "Finish".

In the next window, you should provide a description for this DSN that is understandable, for example, AccessDB. Then, click "Select.. . "to choose the Access database file you uploaded in the previous step. After opening it, you select the "OK" option to save the selected DSN.

3. Configure the Website or Web Application

Unfortunately, you cannot simply tell your web server to use the DSN you just created for your Access database; you have to configure your web server to utilize the DSN properly.

Suppose you work with a web application or CMS like WordPress, Joomla or Drupal. In that case, the path to settings may be hidden in certain config files (for WordPress, it is wp-config. php), and the required modifications must be made with the help of updated DSN parameters.

When designing a new Access application, you must tweak your code further to connect to the Access database through the DSN. Here is an example of how to set up a PHP application out of the box:

$dsn = 'odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\inetpub\vhosts\your-domain.com\httpdocs\database\mydb.mdb;Uid=;Pwd=;';

$conn = new PDO($dsn);

Replace C:\inetpub\vhosts\your-domain. com\httpdocs\database\mydb. mdb with the actual path of the location where the Access database file resides on the server.

4. Test the Connection

In the final stages of setting up your website or web application, you should check the connections to your Access database to ensure everything works properly.

Here, sample operations you can try are registering a new user, logging in to a page, searching for content or products, and editing, modifying, or deleting an entry in the Database provided on the web application or CMS.

If you are designing a unique web application using Access, you can write a script to check the connection and make minor queries using the Access model.

5. Secure the Access Database

While Microsoft Access databases don't have robust security features like other database management systems, taking precautions to secure your Access database is still important.

- Restrict Access to the database file by placing it outside the web root directory (e. g. , C:\\inside a intranet domain \inside srv \inside iis server \onsite Domain Name System \inetpub \vhosts \YOUR_DOMAIN. com\database\mydb. mdb).

- Encrypt data by Database or use password protection if you have important data stored in the Access database.

- View copies of the Access database file because the data from the Access database can be wiped out during a disk crash.

Using the instructions provided, you should be able to establish a connection between a Microsoft Access database and a site or web application based on a Windows server with Plesk.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!