Download here

Transcript
Smartphone 3.1
a number (from 0 to 15) that will be assigned to a
recordset if opened successfully. Any further reference to this recordset from any other function
will be made by this number, and no other recordset will be able to use this number until this
recordset is closed (with Drop function).
For other SQL queries: -1
sql : (string)
Any string that presents a valid text of an SQL
query or a stored procedure call, for example:
"SELECT * FROM Users WHERE Code
BETWEEN 110 AND 911;"
or
"INSERT INTO Users (Code, Name) VALUES
("911", "Rescue");"
"{call StoredProcSelectAll}"
Remarks
If the Execute function is called to open a new
recordset with the number that was already
assigned to some other open recordset, the recordset that had this number is closed automatically,
and the requested number is assigned to a new
recordset.
Queries that do not return recordsets (CREATE,
INSERT, UPDATE etc.) still do use temporary
ones during execution. Such temporary recordset
is automatically assigned a first free number from
0 to 15. Since no recordsets should be returned by
such query, its temporary recordset is closed
when the query execution ends, and the autoassigned number becomes available again.
If you have all numbers from 0 to 15 assigned to
open recordsets and you run the Execute function
with "-1" as a first parameter, this new query will
not automatically close any recordset in order to
get a free number. In this situation, a new query
will not be able to open a temporary recordset and
the Execute function will return an error.
Drop function
int db::Drop( int recordset );
Closes a recordset previously opened with
SELECT SQL query.
Return value (integer)
true: recordset closed successfully
false: recordset closure failed.
Parameters
recordset : (integer)A number assigned to a
recordset to be closed.
Remarks
Since the pool of recordset numbers is limited (015), it is a good practice to close any recorset with
Drop function once you don't need it open any
more. It may help you to avoid the situation when
the Execute function with "-1" as a first parameter
returns an error because the query is unable to
open a temporary recordset due to lack of free
numbers to be assigned to it automatically.
Fetch function
int db::Fetch( int recordset, int go, int
param=0 );
Navigates through the records in the open recordset.
Return value (integer)
true: successful move
false: move failed
Parameters
recordset : (integer) A number (from 0 to 15)
assigned to the recordset you are going to navigate through;
158
•
•
•
•
•