Search code examples
phpmysqlsql-serverms-accessodbc

Linking MS Access and database server without installing any additional drivers


on our company-website, we have an html-form, where an e-mail is generated via php for consulting reasons - which works fine. My superiors want me to save the information of the html-form into an MS Access-database.

I couldn't come up with a solution that directly writes from php into MS Access - so I convinced them to go with MySQL via phpMyAdmin - linking the tables via ODBC in Access.

The connection between php and MySQL was easy, and the connection between MS Access and MySQL would've also been:

To do that, an ODBC-MySQL-Provider is required for each Client to open the Database, which the IT-department doesn't want to install.

We also use an MS SQL Server on an Windows Server - I could also connect php to SQL Server - but in this case we need to install the ODBC SQL Server Provider when linking the tables or the SQL Server Native Clients if we go with Ado. - IT guys:

no installation of providers on all clients.

My question is:

Is there any possible solution for accessing MySQL/SQL Server from MS Access without the installation of ODBC-Providers at all?

I have really high pressure on this and can't find anything that could satisfy user-needs and expectations.

Thanks in advance

Baris

Edit: the working php/MySQL-Code - based on mysqli

$servername = "----------.de";
$username = "-------";
$password = "--------";
$dbName = "---------";
$port = "-------";

$con= mysqli_connect($servername, $username, $password, $dbName, $port );
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

The following connection-string works for connecting to a server-side ms sqlserver from MS Access with the integrated SQLSRV32.dll-provider. Thanks to GordThompson

cs = "Driver={SQL Server};"
cs = cs & "Server=ip-adress,port-number;"
cs = cs & "Database=database-name;"
con.Open cs, "username", "password"

Since there is a possiblity to connect to the SQL Server without additional provider, I am going for the PDO/SQLServer-combination, and loading the data based on the connection-string above.


Solution

  • Since the overriding concern is to avoid installing additional drivers on the client machines and you have a Microsoft SQL Server available to you then you can

    1. Have your PHP script write the required information to the SQL Server, and then

    2. Create an Access process that retrieves the information from the SQL Server using the "SQL Server" ODBC driver that is installed with every copy of Windows.