Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    I have a client who wants to use PHP to pull data from an Access database file, in attempting to connect to the database i get a blank screen, please help:

    PHP Code:
    <? 
    $D 
    "CONNECTION POINT"//omited for public viewing

    $dbc = new COM("ADODB.Connection"); 
    $connstr "DRIVER={Microsoft Access Driver (*.mdb)};"
    $connstr .= "DBQ=".$D."TravelDB.mdb;uid=;pwd=;"


    $dbc->open($connstr); 
    $rs $dbc->execute("SELECT * FROM CUS"); 
    while(!
    $rs->eof()) { 
    print 
    " | ".$rs->fields['CUS_NUMBER']->value().""
    print 
    " | ".$rs->fields['CUS_NAME']->value().""
    print 
    " | ".$rs->fields['CUS_STREET_ADRESS']->value().""
    print 
    " | ".$rs->fields['CUS_SECOND_ADRESS']->value().""
    print 
    " | ".$rs->fields['CUS_CITY']->value().""
    print 
    " | ".$rs->fields['CUS_PROV']->value().""
    print 
    " | ".$rs->fields['CUS_POSTAL']->value().""
    print 
    " | ".$rs->fields['CUS_SLP_NUMBER']->value().""
    print 
    "\n<BR>\n"
    $rs->movenext(); 






    $dbc->close(); 
    ?>
    Thee Pyro Wolf

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Found this on www.php.net:

    http://www.php.net/manual/en/ref.com.php#49896
    PHP Code:
    <?
    //Connect Database
    $dbfile='D:\DB\log.mdb';
    $conn = new COM("ADODB.Connection") or die("Cannot start ADO");
    $conn->Open(DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".$dbfile; );
    $rs = $conn->Execute("Select From tb_sql");
    $tmp_result=$rs->Fields("count");
    $result[$count]=$tmp_result->value;
    echo "
    $count ==> $result[$count] <br>";
    $rs->Close();

    ?>
    if use version 4.3.10 with windows 2003 can not run "$conn->Open()"

  4. #3
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    thank you for your response, as you can see, it is an unusual request and i much prefer working with a Mysql or equivalent type database.
    Thee Pyro Wolf


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:16 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com