apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: DB_ado

Source Location: /DB_ado-1.3.1/ado.php

Class Overview

DB_common
   |
   --DB_ado



Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]


[ Top ]


Class Variables

$affected =

[line 106]

Result of affected rows
  • See: affectedRows(), simpleQuery()

Type:   variant


[ Top ]

$autocommit =  true

[line 89]

Flag for method commit(), default no commit on every query
  • Var: default true
  • See: autoCommit(), adoTrans(), commit(), rollback()

Type:   boolean


[ Top ]

$connection =

[line 64]

Points on ADODB.Connection
  • Var: (COM)
  • See: connect(), simpleQuery(), disconnect()

Type:   object ADODB.Connection


[ Top ]

$dbsyntax =

[line 81]

Database used with regards to SQL syntax etc.
  • See: connect(), createSequence(), toString()
  • Todo: defining special OLEDB-Provider (mssql, access, odbc)

Type:   string


[ Top ]

$phptype =

[line 72]

Database backend used in PHP (mysql, odbc etc.)
  • See: connect(), toString()

Type:   string


[ Top ]

$recordset =

[line 114]

Points on ADODB.Recordset
  • Var: (COM)
  • See: simpleQuery(), disconnect()

Type:   object ADODB.Recordset


[ Top ]

$transaction_opcount =  0

[line 98]

Flag to see how often a commit was started, Default no commit on every query
  • Var: default true
  • See: autoCommit(), simpleQuery(), rollback()

Type:   boolean


[ Top ]



Method Detail

DB_ado (Constructor)   [line 184]

void DB_ado( )

DB_ado constructor.

Visit http://support.microsoft.com/default.aspx?scid=kb;EN-US;q168354 for $errorcode_map

  • See: DB::common(), $dbsyntax, $phptype
  • Access: public

[ Top ]

adoIsError   [line 832]

boolean adoIsError( none 0)

Checking if an ADODB.Connection error occured
  • Return: TRUE error(s) occured, FALSE no error occured
  • Since: 1.0
  • Access: public

Parameters:

none   0   — 

[ Top ]

adoRaiseError   [line 796]

void adoRaiseError( [integer $errno = null])

Raise an error and set as param nativecode on raiseError() result-string of errorNative()
  • See: errorNative(), raiseError()
  • Since: 1.0
  • Access: public

Parameters:

integer   $errno   —  (optional) default null

[ Top ]

adoRaiseErrorEx   [line 813]

void adoRaiseErrorEx( [integer $errno = null])

Raise an error and set as param nativecode on raiseError() result-string of errorNative()
  • See: errorNativeEx(), raiseError()
  • Since: 1.0
  • Access: public

Parameters:

integer   $errno   —  (optional) default null

[ Top ]

adoTrans   [line 651]

mixed adoTrans( boolean $onoff)

Checking of transaction support by OLEDB-Provider.

Normally the startpoint of an transaction will be set here

  • Return: TRUE on success, FALSE if transaction is not supported
  • See: $autocommit, $transaction_opcount
  • Throws: DB_Error
  • Access: public

Parameters:

boolean   $onoff   — 

[ Top ]

affectedRows   [line 525]

integer affectedRows( )

Gets the number of rows affected by the last manip query.
  • Return: number of rows affected by the last query
  • See: $affected
  • Since: 1.0
  • Access: public

[ Top ]

autoCommit   [line 633]

boolean autoCommit( [boolean $onoff = false])

Enable automatic commit.
  • Return: always TRUE
  • See: $autocommit
  • Access: public

Parameters:

boolean   $onoff   —  (optional) default false

[ Top ]

commit   [line 682]

boolean commit( none 0)

Starts a commit
  • Return: TRUE on success
  • See: $autoCommit()
  • Throws: DB_Error
  • Access: public

Parameters:

none   0   — 

[ Top ]

connect   [line 235]

mixed connect( $dsn $dsninfo, [$persistent $persistent = false])

Connect to a database and log in as the specified user.
  • Return: DB_OK on success or DB_Error on failure
  • See: adoIsError(), adoRaiseError(), raiseError()
  • Throws: DB_Error
  • Access: public

Parameters:

$dsn   $dsninfo   —  the data source name (see DB::parseDSN for syntax)
$persistent   $persistent   —  (optional) whether the connection should be persistent (actually not supported persistent COM objects in php)

[ Top ]

createSequence   [line 571]

void createSequence( $seq_name)


Parameters:

   $seq_name   — 

[ Top ]

disconnect   [line 286]

boolean disconnect( )

Close ADODB.Recordset, ADODB.Connection and delete vars to free memory.
  • Return: always TRUE
  • See: $connection, $recordset
  • Access: public

[ Top ]

dropSequence   [line 593]

void dropSequence( $seq_name)


Parameters:

   $seq_name   — 

[ Top ]

errorNative   [line 767]

string errorNative( )

Get the native error code of the last error (if any) that occured on the current ADODB.Connection
  • Return: ADODB.Error
  • Since: 1.0
  • Access: public

[ Top ]

errorNativeEx   [line 728]

string errorNativeEx( )

Get the extended error collection of the current ADODB.Connection
  • Return: ADODB.Error
  • Since: 1.0
  • Access: public

[ Top ]

fetchInto   [line 398]

mixed fetchInto( object $result, &$arr, integer $fetchmode, [integer $rownum = null], array $arr)

Fetch and return a row of current ADODB.Recordset.

Internally we do some important transformations for right php result. Take a look at ADODB.DataTypeEnum for details.

  • Return: DB_OK on success, NULL on no more rows
  • Todo: BINARY DATA handling
  • Access: public

Parameters:

object   $result   —  ADODB.Recordset
array   $arr   —  (reference) where data from the row is stored
integer   $fetchmode   —  how the array data should be indexed
integer   $rownum   —  the row number to fetch
   &$arr   — 

[ Top ]

freeResult   [line 613]

boolean freeResult( object $result)

Free the internal resources associated with $result (basicly it means close recordset)
  • Return: always TRUE
  • Since: 1.0

Parameters:

object   $result   —  ADODB.Recordset

[ Top ]

getProvider   [line 1237]

string getProvider( )

Returns ADODB Provider
  • Return: ADODB version

[ Top ]

getVersion   [line 1222]

string getVersion( )

Returns ADODB version
  • Return: ADODB version

[ Top ]

isTypeOfBinary   [line 1253]

boolean isTypeOfBinary( integer $value)

Checks if field is a binary type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfBit   [line 1269]

boolean isTypeOfBit( integer $value)

Checks if field is a bit type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfChar   [line 1285]

boolean isTypeOfChar( integer $value)

Checks if field is a char type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfCurrency   [line 1410]

boolean isTypeOfCurrency( integer $value)

Checks if field is a currency type (which is not supported by php)
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfDate   [line 1303]

boolean isTypeOfDate( integer $value)

Checks if field is a date type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfDecimal   [line 1318]

boolean isTypeOfDecimal( integer $value)

Checks if field is a decimal type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfDouble   [line 1348]

boolean isTypeOfDouble( integer $value)

Checks if field is a double type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfFloat   [line 1363]

boolean isTypeOfFloat( integer $value)

Checks if field is a float type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfInteger   [line 1393]

boolean isTypeOfInteger( integer $value)

Checks if field is a integer type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfNumeric   [line 1333]

boolean isTypeOfNumeric( integer $value)

Checks if field is a numeric type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfReal   [line 1378]

boolean isTypeOfReal( integer $value)

Checks if field is a real type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfTime   [line 1425]

boolean isTypeOfTime( integer $value)

Checks if field is a time type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

isTypeOfTimestamp   [line 1440]

boolean isTypeOfTimestamp( integer $value)

Checks if field is a timestamp type
  • Return: TRUE on match, FALSE if other type
  • Access: public

Parameters:

integer   $value   —  fieldtype

[ Top ]

nextId   [line 541]

mixed nextId( $seq_name $seq_name, [$ondemand $ondemand = true])

Get the next value in a sequence. Depends on $dbsyntax which type we use
  • Return: a sequence integer or DB_Error
  • Access: public

Parameters:

$seq_name   $seq_name   —  the name of the sequence
$ondemand   $ondemand   —  whether to create the sequence table on demand (default is true)

[ Top ]

nextResult   [line 376]

void nextResult( object (reference) $result)

Move the internal ADODB.Recordset result pointer to the next available result.
  • Access: public

Parameters:

object (reference)   $result   —  ADODB.Recordset

[ Top ]

numCols   [line 486]

integer numCols( object $result)

Get the number of columns in a recordset.
  • Return: the number of columns per row in $result
  • Since: 1.0
  • Access: public

Parameters:

object   $result   —  ADODB.Recordset

[ Top ]

numRows   [line 507]

integer numRows( object $result)

Get the number of rows in a ADODB.Recordset.

Note: If cursor type supports does not support RecordCount, the result is always adUnknown = -1.

  • Return: number of rows in ADODB.Recordset
  • See: setCursorType()
  • Since: 1.0
  • Access: public

Parameters:

object   $result   —  ADODB.Recordset

[ Top ]

rollback   [line 706]

boolean rollback( none 0)

Starts a rollback
  • Return: TRUE on success
  • See: $autoCommit()
  • Throws: DB_Error
  • Access: public

Parameters:

none   0   — 

[ Top ]

setCursorLocation   [line 923]

boolean setCursorLocation( [integer $value = 3])

Set the cursor location for ADODB.Connection

CursorLocationEnum adUseServer = 2 adUseClient = 3

  • Return: TRUE we set the $value, FALSE wrong Enum was given
  • See: $_cursor_location
  • Since: 1.0
  • Access: public

Parameters:

integer   $value   —  (optional) default 3

[ Top ]

setCursorType   [line 899]

boolean setCursorType( [integer $value = -1])

Set the cursor type for ADODB.Recordset.

Only for catching records.

Notes: Use adOpenKeyset = 1 or adOpenstatic = 3 to get a value > 0 of numRows().

CursorTypeEnum adOpenUnspecified = -1 adOpenForwardOnly = 0 adOpenKeyset = 1 adOpenDynamic = 2 adOpenStatic = 3

  • Return: TRUE we set the $value, FALSE wrong Enum was given
  • See: numRows(), $_cursor_type
  • Since: 1.0
  • Access: public

Parameters:

integer   $value   —  (optional) default -1

[ Top ]

setExecuteOption   [line 860]

boolean setExecuteOption( [integer $value = -1])

Set execute option for ADODB.Connection. Only for manip queries.

CommandTypeEnum adCmdText = 1 adCmdTable = 2 adCmdStoredProc = 4 adCmdUnknown = 8 adCmdFile = 256 adCmdTableDirect = 512

  • Return: TRUE we set the $value, FALSE wrong Enum was given
  • See: $_execute_option
  • Since: 1.0
  • Access: public

Parameters:

integer   $value   —  (optional) default -1

[ Top ]

setLockType   [line 950]

boolean setLockType( [integer $value = -1])

Set the lock type for ADODB.Recordset. Only for catching records.

LockTypeEnum adLockUnspecified = -1 adLockReadOnly = 1 adLockPessimistic = 2 adLockOptimistic = 3 adLockBatchOptimistic = 4

  • Return: TRUE we set the $value, FALSE wrong Enum was given
  • See: $_lock_type
  • Since: 1.0
  • Access: public

Parameters:

integer   $value   —  (optional) default -1

[ Top ]

setMaxRecords   [line 973]

boolean setMaxRecords( [integer $value = 0])

Setting of MaxRecords to get only xx records on every query

Note: msdn-article (Q186267) "PRB: MaxRecords Property Is Not Used in Access Queries with ADO"

  • Return: TRUE we set the $value, FALSE no integer value was given
  • See: $_max_records
  • Since: 1.0
  • Access: public

Parameters:

integer   $value   —  (optional) default 0

[ Top ]

simpleQuery   [line 319]

mixed simpleQuery( string $query)

Sending a query through ADODB.Connection and recieve ADO.Recordset as result.

For manip queries we use ADODB.Connection execute method instead of ADO.Recordset open method.

  • Return: object ADODB.Recordset or DB_Error on failure
  • See: $connection, $recordset, $_max_records, $_cursor_type, $_lock_type, $_execute_option, $transaction_opcount, adoTrans(), commit()
  • Throws: DB_Error
  • Access: public

Parameters:

string   $query   —  sql statement

[ Top ]

tableInfo   [line 1053]

void tableInfo( $result, [ $mode = null])


Parameters:

   $result   — 
   $mode   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:29:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.