adoRecordSet
Previous Topic  Next Topic 

Synopsis:

       adoRecordset(name,conHandle,prvpub_flag)

Arguments:

       conHandle - The connection handle of the connection object to associate with this recordset.

       name - An optional name that will uniquely identify the recordset object (mainly for public recordsets)

       prv_or_pub - Set to 0 for Private recordset, 1 for public recordset(optional - default private)


Description:  This function creates a recordset object on the connection specified by conHandle and returns a unique recordset handle to the created object.     The recordset object can be opened in private or public mode and can be given an optional name, which can be used by other tasks to retrieve the handle using the adoRSetGetHandle(name) function.


A private recordset can only be accessed from the task that created it,  and any attempt to access a recordset from another task will result in an error.    When a task ends (either through a chain to another task, a stop or restart statement is encountered, the end of program  is reached or the task is explicit killed),  then all private recordsets that the stopped task created will be closed and released.      If  the connection with which the recordset is associated with is closed then the created recordset will also be automatically closed and released along with it.


Public recordsets can be accessed from any task once it has been created.      If the task that created it is stopped for any reason then the public recordset will not be closed and released (it must be done explicitly).          


There are two constants defined in the ado.inc file as follows:


const TYPE_PRIVATE=0;

const TYPE_PUBLIC=1;


The maximum number of simultaneous recordsets that can be open at any one time 2048 (ie there are 2048 recordset handles available).


If a name is provided for a public recordset then other tasks can obtain the recordset handle by using adoRSetGetHandle(name).    All names must be unique, although a blank name can be given for multiple public connections, however then the handle cannot be retreived using adoConnGetHandle(name) and must be obtained another way (E.g. global variable).       Giving a name to a private recordset is of little use since the handle will only be retrievable from the task that called the function (which should already have obtained the handle from the return value).


Both name and priv_or_pub arguments can be omitted, in which case a private, nameless recordset will be created.



Returns:  Returns the connection object handle or a negative error code.