	GNADE Recordset
	===============

Introduction
============

This package is a GNADE ODBC access simplification.
It's mainly intended for simple applications or simple database access.
The code needed to access the database is reduced at the cost of some flexibility, and maybe performance.

Package description
===================
These are the descriptions of the functions provided by the package. An example of how these functions are used is included in the file named lista4.adb

pgrecordset_ptr
	Is the object to contain all the information about the DB connection and last query.
	
function Recordset_New(Conninfo : String; Username : String := ""; Passwd : String := "") return Pgrecordset_ptr;

	This function creates a new recordset object. Parameters are the ODBC connection name, the user name and associated password.

procedure recordset_Close(recordset : in out Pgrecordset_Ptr);
	
	This function closes the DB connection and deletes the recordset object.

function Error (Recordset : Pgrecordset_Ptr) return Boolean;
	
	Returns if the last action taken in the connection resulted 0.

function Error_Msg (Recordset : Pgrecordset_ptr) return String;
procedure Error_Msg (Recordset : Pgrecordset_Ptr; Msg : out String);

	Both return a string containing the string associated to the error produced by the last operation.

procedure Query (Recordset : in out Pgrecordset_Ptr; Query : String);

	Sends a SQL query trough this DB connection. The recordset object stores the query results.

procedure MoveFirst (Recordset : Pgrecordset_Ptr);
procedure MoveNext (Recordset : Pgrecordset_Ptr);

	These procedures let you move trough the query result. If at the end of the table, a NO_DATA exception is raised.

procedure Exec (Recordset : in out Pgrecordset_Ptr; Cmd : String);

	This procedure sends a SQL command to the database, but gets no results. It's intended to be used with INSERT, DELETE, MODIFY, etc.

function Getcolnums (Rs: Pgrecordset_Ptr) return Integer;

	Returns the number of columns in the last query.

function Getcolname (Rs: Pgrecordset_Ptr; Num: integer) return String;

	Returns the name of the column or field in the last query given by its position. The first field is number 1.

function GetData (Rs: Pgrecordset_Ptr; Column : String) return String;
	
	Returns the data contained in the actual record given the name of the column or field.

BINDINGS
--------

This package lets you to bind variables to the resulting field in a query.
Actually only *string* variables are supported. Every data field will be converted to string.

A binding can be make before, after the query is made or at any other time.

procedure Registerdata (Recordset: Pgrecordset_Ptr; Str: String_Access; Field : String);

	This procedure creates a binding, associating str to the query field given its name. The str needs to be an access variable to be modified every time the the actual record in the query is changed.

Note: The query result is not a dynamic table, so modifying binded variables will NOT change data in the database. It must be made through an SQL command using Exec.


This package is provided by Julio Cano.

       julius_bip@yahoo.com


