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!

Categories

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?

Comments

  • treshrtreshr Posts: 326Member
    You can try this code:
    [code]
    <?PHP

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

    $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";
    $rs->MoveNext();
    }

    print "";

    $rs->Close();
    $conn->Close();
    $rs = null;
    $conn = null;
    ?>
    [/code]

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


    --=][tReShR][=--

  • 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.

    --=][tReShR][=--

Sign In or Register to comment.