# PHP & ODBC/Access Connection

**URL:** <https://forum.kirupa.com/t/php-odbc-access-connection/236641>\
**Category:** programming\
**Created:** [August 22, 2007, 2:25pm UTC](https://forum.kirupa.com/t/php-odbc-access-connection/236641 "2007-08-22T14:25:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neolumi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neolumi/32/1306_2.png) [@Neolumi](https://forum.kirupa.com/u/Neolumi)\
**Post date:** [August 22, 2007, 2:25pm UTC](https://forum.kirupa.com/t/php-odbc-access-connection/236641/1 "2007-08-22T14:25:42Z")

</div>

Hi, I’m attempting to connect to an access database using PHP without DSN, and I’m not having much luck. I need to be able to insert data into the access DB,

I’ve tried this with the alli.mdb file in the same directory as the script:

```php
$dbq = 'alli.mdb';
$db_connection = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbq", "", "") or die("asdsasa");

$result = odbc_tables($db_connection);

   while (odbc_fetch_row($result)){
     if(odbc_result($result,"TABLE_TYPE")=="TABLE")
       echo"<br>".odbc_result($result,"TABLE_NAME");

   }

```

If anyone could help with this thatd be great 🙂
