Skip to content

Instantly share code, notes, and snippets.

@mkoppanen
Last active Dec 26, 2015
Embed
What would you like to do?
<?php
$location = '/mnt/hgfs/projects/test.mdb';
$dsn_name = uniqid("dsn_");
$contents=<<<EOF
[${dsn_name}]
Description = Microsoft Access Try DB
Driver = MDBTools
Database = $location
Servername = localhost
EOF;
$ini_name = '/tmp/' . uniqid ('test_ini_') . '.ini';
file_put_contents ($ini_name, $contents);
putenv ("ODBCINI=${ini_name}");
$conn = odbc_connect("$dsn_name",'','');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment