unable to connect to database(MS access)

Discussion in 'Perl' started by bhavin12300, Apr 7, 2007.

  1. bhavin12300

    bhavin12300 New Member

    Joined:
    Apr 7, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    hi
    i am building .pl script to get connect to database which is in MS access in windows
    but i am able to fetch data from it .it prints nothign.
    here is the code

    $db="emaildb";

    $dbh=DBI->connect("dbi:ADO:$db",'','');

    $sq="select * from emaillists";
    $qry=$dbh->prepare($sq);
    $qry->execute();
    while(@data = $qry->fetchrow_array()){
    print @data[1];
    }

    i have created DSN with this database in windows
    wating plzzzzzzzzzz
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    check whether its connecting or not...

    Code:
          $dbh=DBI->connect("dbi:ADO:$db",'','') or die("$!");
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice