Go to Scriptcase store

# Connection with MS Access ADO

Scriptcase provides two drivers for connecting to the Access database: ADO and ODBC. For more information on how to enable the MS Access ODBC driver, see our documentation.

In Scriptcase, you can also convert tables from Access database files.(.mdb or .accdb) for databases: MySQL, PostgreSQL, SQLite and SQL Server. For more information, see our documentation for database import.

## Prerequisites

To create a Scriptcase connection to the Access Database using the ADO connection, you must use the full path to the database file.

In Scriptcase automatic installation, the COM extension is already enabled in PHP, and only requires the following elements:

- The PHP architecture of Scriptcase and Access must be equivalent.
- Microsoft Access Database Engine 2010 client installed.
- The access database (.mdb or .accdb) must be stored on the same Scriptcase server/machine with one or more tables created.

### Checking the PHP Architecture

Before continuing with this documentation, it is important to check your PHP architecture inside phpinfo(). If you are using Scriptcase’s automatic installer, the PHP architecture will be the same as that of the downloaded installer.

You can access the phpinfo of your Scriptcase through your own path, like:

`http://127.0.0.1:8092/scriptcase/info.php`

- x86 Architecture = 32 Bits
- x64 Architecture = 64 Bits

### Installing the Microsoft Access Database Engine 2010 Driver

- First we must download Driver Access Database Engine 2010 according to your PHP architecture:

Access Database Engine 2010 x86 | Download
Access Database Engine 2010 x64 | Download

#### After download, run the file to install the engine:

1 - Click “Next” to continue the installation.

2 - Accept the license terms and agree to continue.

3 - Set the path of the Access Engine installation. You can also use the default path entered by the installer.

4 - Installation complete, click “OK” to finish.

## Create a connection in Scriptcase

In this documentation we will show the connection to the Access database file.

1 - Access any project from your Scriptcase.

2 - Click on the New Connection icon to create a connection.

or access the Database > New Connection menu tab.

After that, a new page will appear with all database connections.

- Select connection “MS Access”.

- Select DBMS Driver: MS Access ADO

### Connecting to Scriptcase

In this type of connection, we must enter the full path to the Access database file to make the connection.

#### Connection name

Define the name of your new connection in Scriptcase.

#### DBMS Driver

Select the access connection controller.

#### Server/Host(Name or IP)

Enter the full path to the Access database file.

#### User

Inform the user to connect to the Access database. This option should only be completed if a user is configured as required when connecting to the Access database.

#### Password

Enter the password to connect to the Access database. This option should only be completed if a password is set as required when connecting to the Access database.

### Filter

We can configure the initial filtering of the information that the database will bring and display.

#### Show

In this option we will define if the connection will bring Tables, Views, System Tables, Procedures.

#### Searches

In this option we can configure the display of specific tables by user. If the elements are empty, the user informed in authentication will see all the data available.

- Tables: We will list the tables that can be displayed or not.

- Owner: We will inform the name of the user who has access to the required tables or to the complete database.

- Show: We will define if the reported elements will be shown or not in this connection.

### Advanced

You can configure more advanced settings for the connection.

#### Decimal separator

This option allows you to define the decimal separator of numerical values. You can choose between dot (`.`) and comma (`,`).

#### Persistent Connection

Enabling this option will close connections when script execution completes.

#### Use the schema before the table name

This option causes Scriptcase to use the database schema before the table names in its actions. For example:

`dbo.Account`

- dbo: It is the name of the scheme used.

- Account: This is the name of the table that is used soon after.

### SSH

Here are the SSH options available in the image and their descriptions regarding database connection:

#### Use SSH

Enables or disables the SSH tunnel for database connection. When enabled, the database connection will be routed through the SSH server.

#### SSH Server

The IP address or hostname of the SSH server that will be used for tunneling. This is the machine that will act as a bridge to access the database securely.

#### SSH Port

The port used to connect to the SSH server.

#### SSH User

The username used to authenticate with the SSH server. This user must have permissions to establish an SSH connection.

#### Authentication method

You can choose two options: password or certificate. When you choose one of the options, a new field will appear below for the configuration.

#### Private cert. file

The private key file used for authentication if the SSH server requires key-based authentication instead of a password.

#### Local port for port forwarding

The local port on the client machine that will be used for forwarding database traffic through the SSH tunnel. This port acts as a bridge between the database client and the remote database.

#### Database server from SSH

The hostname or IP address of the database server as seen from the SSH server. This is necessary when the database is only accessible within the SSH server’s network.

#### Database port from SSH

The port of the database server that will be accessed through the SSH tunnel. This should match the database service’s listening port.