Knowledgebase: How To
DSN-less ODBC Connection to a MS Access Database using PHP
Posted by Tegan King on 15 February 2012 11:23 AM

 

This code sets up a DSN-less ODBC connection to a MS Access Database in PHP 5 on your server platform.



if (!isset($con))
{ $dbfilename = "D:/HostingSpaces/yourspacename/yourwebsite.com/wwwroot/DBfilename.mdb";
$dbuser = "";
$dbpassword = "";
$con = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$dbfilename", $dbuser, $dbpassword);
}

 

 

(2 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Copyright © 2015 EPhost, Inc. All rights reserved.