FaxChange novinky Obsah dokumentace Uživatelská dokumentace Administrátorská dokumentace Rejstřík pojmů Technická podpora Hledání on-line

fxODBC - databázové knihovny

Tato část dokumentace je v Angličtině stejně jako většina vývojářských nástrojů.

This document tries to be instrumental to help FaxChange developers use it's database support. It shows how to deal with various data and structures operations, use them in applications, how to change the configuration settings or write own providers for specific data sources to manage FaxChange data in a very special way.

Contents


Preface

FaxChange as the communication system deals with a great amounts of data that should be processed rapidly. This makes a big reason to treat data managing carefully in a very optimal way.

The database support is based on Microsoft ADO technology offering easy to implement, relatively efficient and uniform access to various database engines. The differences in data-managing are bypassed thru so-called ADO providers - the most common ADO provider MSDASQL uses ODBC API services to ensure the data access to all engines providing ODBC support and it comes with standard ADO installation pack. However database companies are often developing their own ADO providers to get the maximum perfomance out of their products.

This ADO level data access is embraced in the main FaxChange API library named FxODBC40.dll. Library interface exports many services as is described later in section 'Data Manipulation'.

Another important piece of FaxChange database support is database-engine-dependent library called provider. This library takes a part in an environment initialization - it is responsible for physical and logical dbases and tables creating and for their proper structure and design configuration. And finally provider has another considerable feature - it enables to overload the standard FxODBC40.dll services with its own code allowing wide variety of provider's application. For more detailed information take a look at the section 'Providers'.


How It Works

Any application initializes FaxChange Database API by calling fxInit or fxInitEx with the application identifier and the list of tables that gonna be used (and the server name running FaxChange respectively). This causes every table to be initialized, which means following: first the provider library is loaded and found out what services it exports, second InitProvider call is executed (if provider supports one) with table's name as argument, then the ADO provider is set to one selected (or MSDASQL as default) and finally connection to table is opened.

If no problem emerged while initializing then the client's application is allowed to use whatever services it needs on tables it asked for to be attached. If an error occures during any call, the function returns corresponding error code and more detailed description (if available) is sent to event log.

If the application is going to exit or the database supporting API is no longer need, fxClose should be called to close the connections opened, to CloseProvider be executed if provider supports one and to overhead data be freed.


Structures and Tables

The FaxChange data are organized into the following tables: tCsid, tFax, tFile, tPabx, tState and tUser. There's a special structure bound with every table representing the data the table holds except table tFile that keeps the data extracted out of fxFax structure for the sake of efficiency - each file is stored just once and read only when user asks for.

Remark: The 't' sign at the beginning of each table's name occures because of prevention of conflicting situation when e.g. creating a recordset based upon the SELECT query: FROM clause could be not parsed well due to considering table name as to be a keyword - this happens with most of the database engines on User or File table names. And this also is the reason why all the column names begin with 'f' character.


Data Manipulation

All the data are manipulated thru calls appropriate to tables, what is symbolized in each of the functions' name. There is one exception: when working with fxFax structure there are two tables touched - tFax and tFile, and corresponding functions hold Archive word in their prototypes. The '#' sign is a placeholder for this words representing tables the operation applies on - the possibilities are Archive, Csid, Pabx, State and User. Follow the 'Applicable' notice on each of the sections.

The operations on data could be divided into the following sections:

Warning: The above described behaviour is valid only if using genuine FaxChange Database API support. No warranty comes when using third-party providers overloading any of exports.


Providers

To enhance possibilities of data manipulation FaxChange DBase support introduces libraries called providers. Their role in the system is to mediate various database-engines intialization and close-up in a standard manner. Another ability making them a powerful tool is to overload origin FaxChange DBase API with a new code allowing to handle the data however is needed.

The initialization is processed through the following prototype:


FXEXPORT InitProvider(TCHAR *ServerName, TCHAR *AppCode, TCHAR *Table);

The ServerName points out computer, where should the registry configuration data be retrieved from. The AppCode parameter transmits the name of the application, that is opening FaxChange DBase support. The Table holds the name of the table to be initialized (possible values are tCsid, tFax, tFile, tPabx, tState and tUser).

The call shoud return FX_OK if provider overrides all the API services on Table that the application is going to use. If it is FX_CALL_DEFAULT returned, the standard FaxChange DBase engine is assumed to be used and therefore ADO is initialized. Any other returning code makes initialization failed and is passed on to the application.

The close-up service has the following prototype:


FXEXPORT CloseProvider();

Actually it does not matter what this call returns. It's just established to allow the provider make all necessary steps to exit.

For function prototypes to be overloaded by provider look at the section following.


FaxChange DBase API Index

FXEXPORT fxInit(TCHAR *AppCode, TCHAR *Tables);

FXEXPORT fxInitEx(TCHAR *Server, TCHAR *AppCode, TCHAR *Tables);

Initializes FaxChange Database Support by loading provider library, calling its InitProvider method if available. It also prepares ADO objects when provider asks for. It must be the first FaxChange DBase API call.

Returns FX_OK if initialization succeeded, FX_OLE_DISPATCH_EXCEPTION or FX_UNKNOWN_EXCEPTION if an exception raised, FX_ERROR otherwise.

Note: If your application calls archive services, always specify both tFax and tFile tables since they are bound together thru fxFax structure members.

Example:


Out = fxInit(_T("My Application"), _T("tUser;tState;tFax;tFile"));


Out = fxInitEx(_T("GLUM"), _T("Test"), _T("tCsid;"));

FXEXPORT fxClose();

Finishes the work with FaxChange DBase API. Calls CloseProvider if present.

Returns always FX_OK.

Example:


Out = fxClose();

FXEXPORT fxUserAddOpen();

Opens a recordset on tUser table and prepares for user data adding.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxUserAdd(fxUser *NewUser);

Adds a new record to an open recordset filled with data from NewUser structure. If primary key constraint fails on current record, the data are not stored and FX_OLE_DISPATCH_EXCEPTION is returned - you can omit this and continue adding another data and modify those causing primary key duplicate later.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxUserAddClose();

Synchronizes the recordset's contents with tUser table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxUserModifyOpen();

Opens a recordset on tUser table and prepares for user data modifying.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxUserModify(fxUser *OldUser, fxUser *NewUser);

Next to respective record retrieval modifies this with new values. If origin record not found, the new one is added.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxUserModifyClose();

Synchronizes the recordset's contents with tUser table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxUserEraseOpen();

Opens a recordset on tUser table and prepares for user data erasing.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxUserErase(long Id);

Deletes the record with primary key value of Id.

Returns FX_OK if operation succeeded, FX_NOT_FOUND if no record with specified primary key value exists or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxUserEraseClose();

Synchronizes the recordset's contents with tUser table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxUserKill(fxUser *User);

Frees the User pointed structure, including the possibly allocated freetext member.

Returns FX_OK.

Example: See Data Querying above.

FXEXPORT fxUserQueryName(fxUser **Result, TCHAR *Name);

Searches the tUser table for user called Name. Result points to fxUser structure filled with data found or is NULL if no more data is available.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxUserQueryId(fxUser **Result, long Id);

Searches the tUser table for user with identifier Id. Result points to fxUser structure filled with data found or is NULL if data not found.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxUserQueryEmail(fxUser **Result, TCHAR *Email);

Searches the tUser table for user with e-mail Email. Result points to fxUser structure filled with data found or is NULL if no more data is available.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxUserQueryAll (fxUser **Result);

Goes through all the records in tUser table. Result points to fxUser structure filled with data found or is NULL if reached the end of the table.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxUserGetRowsOpen(TCHAR *SortColumns, TCHAR *Filter, int *ColumnIds = FieldsUserIds, long Count = UserCount - 1);

FXEXPORT fxUserGetRowsOpenDefault(TCHAR *SortColumns, TCHAR *Filter);

Opens a recordset on tUser table. You can affect the recordset form by passing following arguments:

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxUserGetRows(long Start, long *Count, fxUser *Result);

Retrieves Count of the records starting with row number Start. All the data is stored into an array pointed by Result.

Returns FX_OK if alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxUserGetRowsClose();

Closes the current recordset.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxUserGetFreeText(fxUser *User);

Retrieves the freetext member of fxUser structure from database. Remember to free this structure using fxUserKill call!

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example:


fxUser *User;
Out = fxUserQueryId(&User, 10);
Out = fxUserGetFreeText(User);

FXEXPORT fxUserSetFreeText(fxUser *User, TCHAR *Freetext);

Sets the freetext member of fxUser structure and updates the database. Remember to free this structure using fxUserKill call!

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example:


fxUser *User;
Out = fxUserQueryId(&User, 10);
Out = fxUserSetFreeText(User, _T("Here comes whatever text you wish to save with this user."));

FXEXPORT fxUserCount(long *Result);

Returns the current recordset record count.

Returns FX_OK if everything is alright, FX_OLE_DISPATCH_EXCEPTION if an exception raised or FX_ERROR if another problem encountered.

Example: See Data Querying above.

FXEXPORT fxPabxAddOpen();

Opens a recordset on tPabx table and prepares for user data adding.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxPabxAdd(fxPabx *NewPabx);

Adds a new record to an open recordset filled with data from NewPabx structure. If primary key constraint fails on current record, the data are not stored and FX_OLE_DISPATCH_EXCEPTION is returned - you can omit this and continue adding another data and modify those causing primary key duplicate later.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxPabxAddClose();

Synchronizes the recordset's contents with tPabx table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxPabxModifyOpen();

Opens a recordset on tPabx table and prepares for user data modifying.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxPabxModify(fxPabx *OldPabx, fxPabx *NewPabx);

Next to respective record retrieval modifies this with new values. If origin record not found, the new one is added.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxPabxModifyClose();

Synchronizes the recordset's contents with tPabx table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxPabxEraseOpen();

Opens a recordset on tPabx table and prepares for data erasing.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxPabxErase(fxPabx *Pabx);

Deletes the Pabx specified record.

Returns FX_OK if operation succeeded, FX_NOT_FOUND if no record with specified primary key value exists or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxPabxEraseClose();

Synchronizes the recordset's contents with tPabx table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxPabxKill(fxPabx *Pabx);

Frees the Pabx pointed structure.

Returns FX_OK.

Example: See Data Querying above.

FXEXPORT fxPabxQueryAll(fxPabx **Result);

Goes through all the records in tPabx table. Result points to fxPabx structure filled with data found or is NULL if reached the end of the table.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxPabxQueryPabx(fxPabx **Result, TCHAR *Pabx);

Searches the tPabx table for record with pabx Pabx. Result points to fxPabx structure filled with data found or is NULL if no more data is available.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxPabxGetRowsOpen(TCHAR *SortColumns, TCHAR *Filter, int *ColumnIds, long Count);

FXEXPORT fxPabxGetRowsOpenDefault(TCHAR *SortColumns, TCHAR *Filter);

Opens a recordset on tPabx table. You can affect the recordset form by passing following arguments:

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxPabxGetRows(long Start, long *Count, fxPabx *Result);

Retrieves Count of the records starting with row number Start. All the data is stored into an array pointed by Result.

Returns FX_OK if alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxPabxGetRowsClose();

Closes the current recordset.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxPabxCount(long *Result);

Returns the current recordset record count.

Returns FX_OK if everything is alright, FX_OLE_DISPATCH_EXCEPTION if an exception raised or FX_ERROR if another problem encountered.

Example: See Data Querying above.

FXEXPORT fxCsidAddOpen();

Opens a recordset on tCsid table and prepares for user data adding.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxCsidAdd(fxCsid *NewCsid);

Adds a new record to an open recordset filled with data from NewCsid structure. If primary key constraint fails on current record, the data are not stored and FX_OLE_DISPATCH_EXCEPTION is returned - you can omit this and continue adding another data and modify those causing primary key duplicate later.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxCsidAddClose();

Synchronizes the recordset's contents with tCsid table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxCsidModifyOpen();

Opens a recordset on tCsid table and prepares for user data modifying.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxCsidModify(fxCsid *OldCsid, fxCsid *NewCsid);

Next to respective record retrieval modifies this with new values. If origin record not found, the new one is added.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxCsidModifyClose();

Synchronizes the recordset's contents with tCsid table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxCsidEraseOpen();

Opens a recordset on tCsid table and prepares for data erasing.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxCsidErase(fxCsid *Csid);

Deletes the record with primary key values of Csid.

Returns FX_OK if operation succeeded, FX_NOT_FOUND if no record with specified primary key value exists or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxCsidEraseClose();

Synchronizes the recordset's contents with tCsid table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxCsidKill(fxCsid *Csid);

Frees the Csid pointed structure.

Returns FX_OK.

Example: See Data Querying above.

FXEXPORT fxCsidQueryAll(fxCsid **Result);

Goes through all the records in tCsid table. Result points to fxCsid structure filled with data found or is NULL if reached the end of the table.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxCsidQueryCsid(fxCsid **Result, TCHAR *Csid);

Searches the tCsid table for record with csid Csid. Result points to fxCsid structure filled with data found or is NULL if no more data is available.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxCsidGetRowsOpen(TCHAR *SortColumns, TCHAR *Filter, int *ColumnIds, long Count);

FXEXPORT fxCsidGetRowsOpenDefault(TCHAR *SortColumns, TCHAR *Filter);

Opens a recordset on tCsid table. You can affect the recordset form by passing following arguments:

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxCsidGetRows(long Start, long *Count, fxCsid *Result);

Retrieves Count of the records starting with row number Start. All the data is stored into an array pointed by Result.

Returns FX_OK if alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxCsidGetRowsClose();

Closes the current recordset.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxCsidCount(long *Result);

Returns the current recordset record count.

Returns FX_OK if everything is alright, FX_OLE_DISPATCH_EXCEPTION if an exception raised or FX_ERROR if another problem encountered.

Example: See Data Querying above.

FXEXPORT fxStateCreate (fxState **Result);

Correctly allocates fxState structure.

Returns FX_OK.

FXEXPORT fxStateAddOpen();

Opens a recordset on tState table and prepares for user data adding.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxStateAdd(fxState *NewState);

Adds a new record to an open recordset filled with data from NewState structure. If primary key constraint fails on current record, the data are not stored and FX_OLE_DISPATCH_EXCEPTION is returned - you can omit this and continue adding another data and modify those causing primary key duplicate later.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxStateAddClose();

Synchronizes the recordset's contents with tState table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxStateModifyOpen();

Opens a recordset on tState table and prepares for user data modifying.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxStateModify(fxState *OldState, fxState *NewState);

Next to respective record retrieval modifies this with new values. If origin record not found, the new one is added.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxStateModifyClose();

Synchronizes the recordset's contents with tState table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxStateEraseOpen();

Opens a recordset on tState table and prepares for data erasing.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxStateErase(TCHAR *Prefix, TCHAR Type);

Deletes the record with primary key values of Type and Prefix.

Returns FX_OK if operation succeeded, FX_NOT_FOUND if no record with specified primary key value exists or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxStateEraseClose();

Synchronizes the recordset's contents with tState table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxStateKill(fxState *State);

Frees the State pointed structure.

Returns FX_OK.

Example: See Data Querying above.

FXEXPORT fxStateQueryAll(fxState **Result);

Goes through all the records in tState table. Result points to fxState structure filled with data found or is NULL if reached the end of the table.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxStateQueryNumber(fxState **Result, TCHAR Type, TCHAR *Prefix);

Searches the tState table for record of type Type with prefix Prefix. Result points to fxState structure filled with data found or is NULL if data not found.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxStateGetRowsOpen(TCHAR *SortColumns, TCHAR *Filter, int *ColumnIds, long Count);

FXEXPORT fxStateGetRowsOpenDefault(TCHAR *SortColumns, TCHAR *Filter);

Opens a recordset on tState table. You can affect the recordset form by passing following arguments:

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxStateGetRows(long Start, long *Count, fxState *Result);

Retrieves Count of the records starting with row number Start. All the data is stored into an array pointed by Result.

Returns FX_OK if alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxStateGetRowsClose();

Closes the current recordset.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxStateCount(long *Result);

Returns the current recordset record count.

Returns FX_OK if everything is alright, FX_OLE_DISPATCH_EXCEPTION if an exception raised or FX_ERROR if another problem encountered.

Example: See Data Querying above.

FXEXPORT fxFileId(long *Result, TCHAR *Filename);

Returns the id of the file named Filename as stored in tFile table. Any path contained in Filename is cut off before searching. If file not found, *Result is set to 0 (notice that ids are one-based).

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

FXEXPORT fxFileName(long Id, TCHAR *Filename);

Fills Filename buffer with the name of the file identified by Id as stored in tFile table. If file with Id not found, buffer stays unchanged.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

FXEXPORT fxFileFreeId(long *Result);

Fills Result buffer with the lowest id not used in tFile table.

FXEXPORT fxFileStore(long *Result, TCHAR *Filename);

Stores file specified by Filename into tFile table. Result holds the id attached to this file.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

FXEXPORT fxFileSave(TCHAR *Filename, TCHAR *DestDir);

Saves file specified by Filename stored in tFile table in DestDir directory.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

FXEXPORT fxArchiveAddOpen();

Opens a recordset on tFax table and prepares for user data adding.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxArchiveAdd(fxFax *NewFax);

Adds a new record to an open recordset filled with data from NewFax structure. If primary key constraint fails on current record, the data are not stored and FX_OLE_DISPATCH_EXCEPTION is returned - you can omit this and continue adding another data and modify those causing primary key duplicate later.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxArchiveAddClose();

Synchronizes the recordset's contents with tFax table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Adding above.

FXEXPORT fxArchiveModifyOpen();

Opens a recordset on tFax table and prepares for user data modifying.

Returns FX_OK if initialization succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxArchiveModify(fxFax *OldFax, fxFax *NewFax);

Next to respective record retrieval modifies this with new values. If origin record not found, the new one is added.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxArchiveModifyClose();

Synchronizes the recordset's contents with tFax table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Modifying above.

FXEXPORT fxArchiveEraseOpen();

Opens a recordset on tFax table and prepares for data erasing.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxArchiveErase(fxFax *Fax);

Deletes the record with primary key value of Fax.

Returns FX_OK if operation succeeded, FX_NOT_FOUND if no record with specified primary key value exists or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxArchiveEraseClose();

Synchronizes the recordset's contents with tFax table and closes one.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Deleting above.

FXEXPORT fxArchiveItems(long *Result, TCHAR *Filter, TCHAR **Error);

Gets count of items in accordance with Filter returning error message in Error. This service is provided for backward compatibility only.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

FXEXPORT fxArchiveKill(fxFax *Fax);

Frees the Fax pointed structure, including the possibly allocated freetext member.

Returns FX_OK.

Example: See Data Querying above.

FXEXPORT fxArchiveQueryId(fxFax **Result, long Id);

Searches the tFax table for fax with identifier Id. Result points to fxFax structure filled with data found or is NULL if data not found.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxArchiveQueryAll(fxFax **Result);

Goes through all the records in tFax table. Result points to fxFax structure filled with data found or is NULL if reached the end of the table.

Note: This type of query demands repeated calling until NULL is returned in Result.

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an OLE exception was generated.

Example: See Data Querying above.

FXEXPORT fxArchiveQuerySet(fxFax *Result, int StartRow, long *Number, TCHAR *Filter, TCHAR **Error);

Gets the fax row set from StartRow record of *Number items in accordance with Filter returning error message in Error. This service is provided for backward compatibility only.

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

FXEXPORT fxArchiveGetRowsOpen(TCHAR *SortColumns, TCHAR *Filter, int *ColumnIds, long Count);

FXEXPORT fxArchiveGetRowsOpenDefault(TCHAR *SortColumns, TCHAR *Filter);

Opens a recordset on tFax table. You can affect the recordset form by passing following arguments:

Returns FX_OK if operation succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxArchiveGetRows(long Start, long *Count, fxFax *Result);

Retrieves Count of the records starting with row number Start. All the data is stored into an array pointed by Result.

Returns FX_OK if alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxArchiveGetRowsClose();

Closes the current recordset.

Returns FX_OK if close-up succeeded or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example: See Data Querying above.

FXEXPORT fxArchiveGetFreeText(fxFax *Fax);

Retrieves the freetext member of fxFax structure from database. Remember to free this structure using fxArchiveKill call!

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example:


fxFax *Fax;
Out = fxArchiveQueryId(&Fax, 10);
Out = fxArchiveGetFreeText(Fax);

FXEXPORT fxArchiveSetFreeText(fxFax *Fax, TCHAR *Freetext);

Sets the freetext member of fxFax structure and updates the database. Remember to free this structure using fxArchiveKill call!

Returns FX_OK if everything is alright or FX_OLE_DISPATCH_EXCEPTION if an exception raised.

Example:


fxFax *Fax;
Out = fxArchiveQueryId(&Fax, 10);
Out = fxArchiveSetFreeText(Fax, _T("Here comes whatever text you wish to save with this fax."));

FXEXPORT fxArchiveCount(long *Result);

Returns the current recordset record count.

Returns FX_OK if everything is alright, FX_OLE_DISPATCH_EXCEPTION if an exception raised or FX_ERROR if another problem encountered.

Example: See Data Querying above.

FXEXPORT fxFree (void *p);

Frees the data pointed by p. This is implemented for backward compatibility only. You should use appropriate fx#Kill service instead.

Returns FX_OK.

zpět na začátek