Both connection and recordset objects can be created either as private or public objects. If a task creates a private object then the created object is only accessible from that task. If any other task attempts to access the object then the function will generate an error.
The connection and recordset objects are created with the following functions:
conHandle=adoConnection([name[,priv_or_pub]]);
setHandle=adoRecordSet(conHandle[,name[,priv_or_pub]]);
If a task ends by encountering a stop or restart statement, or by chaining to another task, or by reaching the end of the program statements, or by an explicit kill command, thenany private objects that the task has created will be closed and released.
Public objects created by a task can be accessed by any other task, and if the creating task ends the object is not closed or released.
It is a good idea to give names to public objects so that other tasks can obtain the handle to that object through the adoConnGetHandle(name) or adoRSetGetHandle(name) functions.
There are two constants defined in the ado.inc file for the private or public types which can be used in the above functions as follows:
## Private and public type constants
const TYPE_PRIVATE = 0;
const TYPE_PUBLIC = 1;