Re: php using odbc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



look this as one example of MSAccess connection:

--------
 <?
 $sDefaultDir         = 'C:\apache\htdocs\MDB'; // path dir MDB
 $sMDBfile            = "cop.mdb";              // MSaccess database name
 
 $sMDBpathAndFilename = $sDefaultDir.'\\'.$sMDBfile;  // concatenate
 
 // define dsn
 $sCfg_dsn = "DRIVER=Microsoft Access Driver (*.mdb);
              DBQ=$sMDBpathAndFilename;
              UserCommitSync=Yes;
              Threads=3;
              SafeTransactions=0;
              PageTimeout=5;
              MaxScanRows=8;
              MaxBufferSize=2048;
              DriverId=281;
              DefaultDir=$sDefaultDir";
 
 // if you need login and pass
 $sCfg_dsn_login = "";
 $sCfg_dsn_mdp = "";
 
  
  $hConn = odbc_connect( $sCfg_dsn, $sCfg_dsn_login, $sCfg_dsn_mdp ) or
           die( "Not connection." );

  $sql = "select * from table";
  $result= odbc_exec($hConn,$sql);

        while(odbc_fetch_row($result)) 
        {
                        $db_field1 = odbc_result($result,"field_name");
        }               
        
?>
----------------

check rest of odbc function in php manual.

bye,




you wrote:

> can u help me?
> 1.i wanna build a connection using odbc but i don't have any example.
> what url can i visit? 
> 2. odbc i want to connect was on this url.. plz view to help me.

> http://indoupload.net/files/view/803/odbc%20problem.jpg

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux