File: D:/HostingSpaces/MDalebout3/prdct.nl/wwwroot/timesheet/includes/adodb5/drivers/adodb-ads.inc.php
<?php
/*
(c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
Portions Copyright (c) 2007-2009, iAnywhere Solutions, Inc.
All rights reserved. All unpublished rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Set tabs to 4 for best viewing.
NOTE: This driver requires the Advantage PHP client libraries, which
can be downloaded for free via:
http://devzone.advantagedatabase.com/dz/content.aspx?key=20
DELPHI FOR PHP USERS:
The following steps can be taken to utilize this driver from the
CodeGear Delphi for PHP product:
1 - See note above, download and install the Advantage PHP client.
2 - Copy the following files to the Delphi for PHP\X.X\php\ext directory:
ace32.dll
axcws32.dll
adsloc32.dll
php_advantage.dll (rename the existing php_advantage.dll.5.x.x file)
3 - Add the following line to the Delphi for PHP\X.X\php\php.ini.template file:
extension=php_advantage.dll
4 - To use: enter "ads" as the DriverName on a connection component, and set
a Host property similar to "DataDirectory=c:\". See the Advantage PHP
help file topic for ads_connect for details on connection path options
and formatting.
5 - (optional) - Modify the Delphi for PHP\X.X\vcl\packages\database.packages.php
file and add ads to the list of strings returned when registering the
Database object's DriverName property.
*/
// security - hide paths
if (!defined('ADODB_DIR')) die();
define("_ADODB_ADS_LAYER", 2 );
/*--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------*/
class ADODB_ads extends ADOConnection {
var $databaseType = "ads";
var $fmt = "'m-d-Y'";
var $fmtTimeStamp = "'Y-m-d H:i:s'";
var $concat_operator = '';
var $replaceQuote = "''"; // string to use to replace quotes
var $dataProvider = "ads";
var $hasAffectedRows = true;
var $binmode = ODBC_BINMODE_RETURN;
var $useFetchArray = false; // setting this to true will make array elements in FETCH_ASSOC mode case-sensitive
// breaking backward-compat
//var $longreadlen = 8000; // default number of chars to return for a Blob/Long field
var $_bindInputArray = false;
var $curmode = SQL_CUR_USE_DRIVER; // See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L
var $_genSeqSQL = "create table %s (id integer)";
var $_autocommit = true;
var $_haserrorfunctions = true;
var $_has_stupid_odbc_fetch_api_change = true;
var $_lastAffectedRows = 0;
var $uCaseTables = true; // for meta* functions, uppercase table names
function ADODB_ads()
{
$this->_haserrorfunctions = ADODB_PHPVER >= 0x4050;
$this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
}
// returns true or false
function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
{
global $php_errormsg;
if (!function_exists('ads_connect')) return null;
if ($this->debug && $argDatabasename && $this->databaseType != 'vfp') {
ADOConnection::outp("For Advantage Connect(), $argDatabasename is not used. Place dsn in 1st parameter.");
}
if (isset($php_errormsg)) $php_errormsg = '';
if ($this->curmode === false) $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword);
else $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword,$this->curmode);
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
return $this->_connectionID != false;
}
// returns true or false
function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
{
global $php_errormsg;
if (!function_exists('ads_connect')) return null;
if (isset($php_errormsg)) $php_errormsg = '';
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
if ($this->debug && $argDatabasename) {