Are there any best practices for securely connecting to an Access database from a PHP website over VPN?

To securely connect to an Access database from a PHP website over VPN, it is recommended to use a secure VPN connection to encrypt data transmission and restrict access to authorized users only. Additionally, implementing proper authentication methods and using parameterized queries can help prevent SQL injection attacks.

<?php

$server = 'localhost';
$username = 'username';
$password = 'password';
$database = 'database';

$connection = new COM("ADODB.Connection");
$connectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=path/to/your/database.mdb";
$connection->open($connectionString);

if ($connection) {
    echo "Connected to Access database successfully";
} else {
    echo "Failed to connect to Access database";
}

?>