Visual FoxPro library Fb_post_event.fll
Version: 2.0
Requirements: Firebird Database Server for Windows
File Size: 34 KB
License: Free to Try
The library enables the Firebird POST_EVENT functionality for Visual
FoxPro. Visual FoxPro applications can register for events they wish to
receive notifications about. When an event occurs, a callback function
registered for this event will be called.
The library contains functions:
FB_CONNECT,
FB_STRINGCONNECT,
FB_DISCONNECT,
FB_SUBSCRIBE,
FB_UNSUBSCRIBE.
FB_CONNECT(cServerName, cDatabase, cUserName, cPassword[, nPortNum])
Establishes a connection to a database.
Returns a connection handle.
Parameters:
cServerName
- Specifies the name or network address of the host where the FB server is running.
cDatabase
- Specifies the database.
cUserName
- The FB server login account.
cPassword
- The password of the FB server account logging on.
nPortNum
- The port number FB server is listening.
FB_STRINGCONNECT(cConnString)
Establishes a connection to a database through a connection string.
Returns a connection handle.
Parameters:
cConnString
- Specifies the data source connection string. See your
Firebird ODBC driver connection string.
FB_DISCONNECT(nConnection)
Terminates a connection to a database.
Parameters:
nConnection
- The connection handle to the data source returned by FB_CONNECT().
FB_SUBSCRIBE(nConnection, cEventName, cCallBackFunctionName)
Registers an event.
Parameters:
nConnection
- The connection handle to the data source returned by FB_CONNECT().
cEventName
- Specifies the event.
The event name can be a maximum of 64 characters in length.
cCallBackFunctionName
- The parameter can be any Visual FoxPro command or function that
will be executed when the specified event occurs. Use keyword
to specify where event message must be placed. Example: "? "
will output message to active screen.
The parameter can be a maximum of 64 characters in length.
FB_UNSUBSCRIBE(nConnection, cEventName)
Unregisters an event.
Parameters:
nConnection
- The connection handle to the data source returned by FB_CONNECT().
cEventName
- Specifies the event.
The event name can be a maximum of 64 characters in length.
SET LIBRARY TO FB_POST_EVENT.FLL
nConn = Fb_connect("192.168.0.1",
"c:/Program Files/Firebird/Firebird_2_0/TEST_DATA.fdb",
"SYSDBA", "masterkey")
IF ERROR() = 0
Fb_subscribe(nConn, "Test1", "? ")
ENDIF
*
* Execute procedure on FB server that is call POST_EVENT "Test1"
* execute "commit;" statement
* The "Test1" string will output into main VFP screen.
*
Fb_unsubscribe(nConn, "Test1")
SET LIBRARY TO