1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    check whether its connecting or not...

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

Share This Page