CLASS:

 

 

 

 

 

 

 

 

 

DESCRIPTION:

 

 

 

Represents an open connection to a data source.

 

 

 

 

 

SYNTAX:

 

 

 

[<oRef> =] new ADODatabase()

 

 

 

 

 

 

 

 

 

PROPERTY:

DEFAULT:

DESCRIPTION:

 

 

baseClassName

ADODATABASE

Identifies the object as an instance of the ADODatabase class

 

 

className

ADODATABASE

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

 

 

name

Empty string 

The name of custom object

 

 

parent

null

Container form or report 

 

 

active

false

Whether the object is open and active or closed.

 

 

catalog

Object

A reference to the ADOXCatalog object that contains the catalog of database objects. (ADO Catalogs and ADOX objects are not currently implemented in dBASE Components)

 

 

catalogName

Empty string 

Current database catalog name.

 

 

commands

Object

A reference to an array that contains the ADOCommand objects.

 

 

commandTimeout

30

In seconds, how long to wait while executing a command before terminating the command and issuing and error.

 

 

connectionString

Empty string 

Connection statement that describes parameters used to establish a connection with data source.

 

 

connectionTimeout

15

In seconds, how long to wait while establishing a connection before terminating the attempt and issuing and error.

 

 

connectOptions

0 - Unspecified

Available options that can be used to open a connection to a data source.

 

 

cursorLocation

0 - Client

Location of the cursor service.

 

 

databaseName

Empty string 

Database alias name.

 

 

errors

Object

A reference to an array that contains the ADOError objects.

 

 

executeOptions

0 - Unspecified

Available options that can be used to execute command.

 

 

handle

0

ADO statement handle.

 

 

isolationLevel

1 - Read Committed

Determines the isolation level of a transaction.

 

 

loginPrompt

2 - Complete

Whether a login dialog appears immediately before opening a connection to data source.

 

 

loginString

Empty string 

User name and password used to login to a data source.

 

 

mode

0 - Unknown

Available permissions for modifying data.

 

 

properties

AssocArray

A reference to Associative array that contains the dynamic properties.

 

 

provider

MSDASQL

Database Provider short name.

 

 

schemaName

Empty string 

Current database schema name.

 

 

share

1 - All

How to share the database connection.

 

 

state

0 - Closed

Enum that indicates the state object.

 

 

transLevel

0

Current level of transaction.

 

 

transOptions

0 - Unspecified

Available options that can be used to the transaction operations.

 

 

version

Empty string 

ADO engine version number.

 

 

 

 

 

EVENT:

PARAMETERS:

DESCRIPTION:

 

 

canClose

 

Event fired when there’s an attempt to deactivate a database; return value determines if the object is deactivated.

 

 

canOpen

 

Event fired when attempting to open a database; return value determines if object is opened.

 

 

canTransact

<state expN>

Event fired when attempting to call transaction method; return value determines if the state of transaction is changed.

 

 

onClose

 

Event fired after a database is successfully closed.

 

 

onExecute

<cmd expC><result expL>

Event fired after a current command is successfully executed or execute is failed.

 

 

onOpen

 

Event fired after a database is successfully opened.

 

 

onProgress

<percent expN>,<type expN>,<status expN>,<msg expC>

Event fired periodically during long-running data processing operations.

 

 

onTransact

<state expN>

Event fired after the transaction method is successfully called.

 

 

 

 

 

 

 

 

 

 

METHOD:

PARAMETERS:

DESCRIPTION:

 

 

open

 

Opens a database connection.

 

 

close

 

Closes a database connection.

 

 

cancel

 

Cancels execution of a pending, asynchronous method call.

 

 

executeSQL

<cmd expC>[,<rowret expL>]

Executes the specified SQL statement.

 

 

getSchema

<schema expC>[,<criteria expC>][,<criteria expA>]

Returns information about a database.

 

 

beginTrans

 

Begins transaction and starts logging changes.

 

 

rollback

 

Cancels the transaction by undoing all logged changes.

 

 

commit

 

Commits changes made during transaction; ends transaction

 

 

createCatalog

[<string expC>]

Creates a new catalog for a new database.

 

 

 

 

 

 

 

 

 

 

DESCRIPTION:

 

 

This class object represents a unique session with a data source. In the case of a client/server database system, it may be equivalent to an actual network connection to the server. 

 

 

Through this connection, you can access and manipulate a database.

 

 

If you want to access a database multiple times, you should establish a connection using this object class. 

 

 

 

 

 

 

 

 

EXAMPLES:

 

 

 

 

 

Execute SQL commands.

How do I execute sql commands in ADODatabase object?

You would use the syntax for the particular DBMS and Driver you are connecting to.

You can usually find the proper syntax by doing a Google search or looking up the driver info.

Here is an example of using the executeSQL command on an ADODatabase object with a MySQL connection using the 5.x MySQL driver.

  

 this.ADODATABASE1 = new ADODATABASE(this)

   with (this.ADODATABASE1)

      onOpen = class::ADODATABASE1_ONOPEN

      onExecute = class::ADODATABASE1_ONEXECUTE

      left = 6.1111

      top = 4.08

      databaseName = "MYSQLTEST_CA"

      active = true

   endwith

 

   function ADODATABASE1_onExecute(cmd)

      ?"Completed "+cmd

      return true

 

   function ADODATABASE1_onOpen

      ?"about to : CREATE TABLE aLongVarChar (ALongText LongText);"

      this.executeSQL("CREATE TABLE aLongVarChar (ALongText LongText);")

      return