Mediator COM interface
Mediator and xHarbour COM interface was designed to enable easy access to Mediator server and DBF files from any environment capable of creating and accessing COM (ActiveX) objects. This includes most of the modern programming languages such as:
- Borland Delphi and C++
- Visual Basic
- Visual C++
- Visual FoxPro
- scripting languages such as Visual Basic Script
- and many, many more
There are two types of COM objects used to interface with Mediator and xHarbour:
- XHbCom.HbConnection - the connection object. This object exposes all Mediator and xHarbour functions which are not related to workarea operation.
- XHbCom.HbTable - table object. It exposes all Mediator and xHarbour functions which operate on workareas. Use it for interacting with Mediator-managed tables and DBF tables managed by xHarbour kernel. When working with Mediator server this object can also be used to execute SQL queries.
Mediator COM interface is based upon xHarbour kernel. Most of the time, the mentioned objects provide a direct interface to existing Mediator and xHarbour functions. Using xHarbour kernel as a foundation for Mediator COM interface enables nearly 100% compatibility between DBF-based applications and Mediator-based applications.
Use these objects to write programs that access Mediator and DBF data in an easy, safe and unified way.
For detailed info about Mediator COM interface see documentation
What can I do with it?
Mediator COM interface brings the new level of connectivity to all wishing to access Mediator server or DBF files. While it is possible to access Mediator-managed data via general purpose SQL interfaces such as ODBC, using our COM interface is preferable due to the following reasons:
- access methods are familiar to all Clipper/xHarbour programmers
- easy and compatible lock management via appropriate
HbTable methods (
RLock, Unlock e.t.c.)
- no need to worry about additional Mediator fields such as
RECNO, IS_DELETED or expression index fields. They are all managed for you automatically
- very efficient ISAM-like access to Mediator and DBF tables
- unified way of access to DBF and SQL data via Mediator makes it simple to write universal applications which can work with both DBF and SQL data. Save your time, look into the feature.
Making it simple: we offer you the possibility to use well-known Clipper/xHarbour/Mediator functions and logic from virtually any Windows programming language you wish. You are not longer limited to Clipper, xHarbour or Harbour.
How does my application work with Mediator COM objects?
It is easy - you create HbConnection and HbTable COM objects in your application and then you call their methods to access data and perform the desired operations in similar way you do it in Clipper or xHarbour.
When working with Mediator server all data references are overtaken by Mediator RDD (MEDNTX or MEDCDX driver), translated into SQL language in Mediator server and sent to the SQL database. The results of SQL queries are returned to the application as if it worked on DBF data.
Most often Mediator server is installed on the same computer as an SQL database
Mediator server may work on a computer with SQL database or it may communicate with the database working on a different computer by the means of network software, such as Oracle SQL*Net or ODBC driver.
Mediator COM interface advantages
- provides the unified way to access Mediator server and DBF files from virtually any Windows programming language
- object methods familiar for all Clipper/xHarbour delelopers
- automatic management of Mediator special columns, expression indexes and repository
- when working with Mediator - overcoming of typical drawbacks and limitations of DBF/ISAM applications
- data security guaranteed by SQL database server
- the access to SQL database features (transactions, SQL language, procedures stored in the server)
- safe and effective work in WAN networks
- an ability of simultaneous cooperation with xBase and Delphi applications using the same Mediator server
- an ability to use the same COM objects to work on SQL and DBF data
- client-server architecture