Ignore:
Timestamp:
06/29/07 15:17:46 (17 years ago)
Author:
niltonneto
Message:

Versão nova do ADODB (4.5 para 4.95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/adodb/tests/test2.php

    r2 r34  
    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
     1<?php 
    22 
    3 <html> 
    4 <head> 
    5         <title>Untitled</title> 
    6 </head> 
     3// BASIC ADO test 
    74 
    8 <body> 
    9 <?php 
    10 /* 
    11   V4.51 29 July 2004  (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved. 
    12   Released under both BSD license and Lesser GPL library license.  
    13   Whenever there is any discrepancy between the two licenses,  
    14   the BSD license will take precedence. 
    15   Set tabs to 8. 
    16  */ 
    17 # 
    18 # test connecting to 2 MySQL databases simultaneously and ensure that each connection 
    19 # is independant. 
    20 # 
    21 include("../tohtml.inc.php"); 
    22 include("../adodb.inc.php");     
     5        include_once('../adodb.inc.php'); 
    236 
    24 ADOLoadCode('mysql'); 
    25  
    26 $c1 = ADONewConnection('oci8'); 
    27  
    28 if (!$c1->PConnect('','scott','tiger'))  
    29         die("Cannot connect to server"); 
    30 $c1->debug=1; 
    31 $rs = $c1->Execute('select rownum, p1.firstname,p2.lastname,p2.firstname,p1.lastname from adoxyz p1, adoxyz p2'); 
    32 print "Records=".$rs->RecordCount()."<br><pre>"; 
    33 //$rs->_array = false; 
    34 //$rs->connection = false; 
    35 //print_r($rs); 
    36 rs2html($rs); 
     7        $db = &ADONewConnection("ado_access"); 
     8        $db->debug=1; 
     9        $access = 'd:\inetpub\wwwroot\php\NWIND.MDB'; 
     10        $myDSN =  'PROVIDER=Microsoft.Jet.OLEDB.4.0;' 
     11                . 'DATA SOURCE=' . $access . ';'; 
     12                 
     13        echo "<p>PHP ",PHP_VERSION,"</p>"; 
     14         
     15        $db->Connect($myDSN) || die('fail'); 
     16         
     17        print_r($db->ServerInfo()); 
     18         
     19        try { 
     20        $rs = $db->Execute("select $db->sysTimeStamp,* from adoxyz where id>02xx"); 
     21        print_r($rs->fields); 
     22        } catch(exception $e) { 
     23        print_r($e); 
     24        echo "<p> Date m/d/Y =",$db->UserDate($rs->fields[4],'m/d/Y'); 
     25        } 
    3726?> 
    38  
    39  
    40 </body> 
    41 </html> 
Note: See TracChangeset for help on using the changeset viewer.