dsn-less connection - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


dsn-less connection

CrushCrush Posts: 43Member
hello. i have this access database and i want to connect to it without using the stupid dsn... can anyone please help?
and would that be possible on linux?


  • treshrtreshr Posts: 326Member
    You can try this code:

    $conn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath("c:/test.mdb");

    $query = "SELECT name,salary FROM emp ";
    $rs = $conn->execute($query);
    $name = $rs->Fields(0);
    $sal = $rs->Fields(1);

    print "Name-------Salary";

    while (!$rs->EOF)
    echo $name->value";
    echo $sal->value";

    print "";

    $rs = null;
    $conn = null;

    Or you can visit this website to get more info: http://www.phpfreaks.com/tutorials/104/1.php


  • CrushCrush Posts: 43Member
    thanks a lot :)
    well, i found out that mysql is better and faster anyway...
    even though the gui sucks. :(
  • treshrtreshr Posts: 326Member
    Did you try to use the MySQL Control Center. Works like a charm and it's free !!!

    Go here to download it: http://dev.mysql.com/downloads/other/mysqlcc.html

    Good luck.


Sign In or Register to comment.