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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.