Create an ODBC Connection With MS Access

Introduction

Open DataBase Connectivity (ODBC) refers to a software API method for using a database management system. A connection with the ODBC API can be established using several popular programming languages including PHP, Perl, Python, .Net etc.

How to create an ODBC connection using Microsoft Access

The following procedure describes how to create an ODBC connection to a Microsoft Access Database.

Step 1

Open the Administrative tools icon in your Control Panel.

Administrative-tools.gif

Step 2

Then double-click the Data Source (ODBC) icon in it.

Step 3

Choose the system DSN tab.

Step 4

Select the "Microsoft Access Driver" and click on "Finish".

Step 5

Click "Select" to locate the database.

Step 6

Now, give the database a Data Source Name (DSN) and click on the "OK" Button.

Now let's determine if the connection was created.

<?php

$conn=odbc_connect('sharad','','');

if (!$conn)

{

die('Could not connect: ' . mysql_error());

}

else

{

echo "Connection has been established.";

}

?>

Output


odbc-connection-check.gif

Up Next
    Ebook Download
    View all
    Learn
    View all