TIBEvents的事件如何触发?由谁触发?

wildhorse01 2003-01-27 09:16:20
TIBEvents的事件如何触发?由谁触发?
是否需要在服务器端写什么SQL语句触发???
举个简单的完整例子?
...全文
33 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
TR@SOE 2003-01-28
  • 打赏
  • 举报
回复
一般你可以在SP中用POST_EVENT抛出一个事件:

post_event ('event_a');

然后在BCB中可以在一个TIBEvent中注册对event_a的关注。

但是,仅仅如此是不行的。IB规定,只有在事务COMMIT之后,TIBEvent才会响应对应的事件。典型代码如下:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
IBTransaction1->StartTransaction();
IBStoredProc1->ExecProc();
IBTransaction1->Commit();

}
//---------------------------------------------------------------------------

void __fastcall TForm1::IBEvents1EventAlert(TObject *Sender,
AnsiString EventName, int EventCount, bool &CancelAlerts)
{
char Msg[128];

sprintf(Msg, "Total Events: %d, Event Name: %s", EventCount, EventName);
ShowMessage(StrPas(Msg));
}
//---------------------------------------------------------------------------
googoler 2003-01-28
  • 打赏
  • 举报
回复
比如,你注册了一个事件,InterBase Server如何触发该事件?
Server怎知何时触发?
--------------------
是通过trigger或procedure触发!

embedsql.pdf page235
devguide.pdf page299

说得很详细!俺当初可找得很辛苦!
wildhorse01 2003-01-27
  • 打赏
  • 举报
回复
比如,你注册了一个事件,InterBase Server如何触发该事件?
Server怎知何时触发?
ai0ai 2003-01-27
  • 打赏
  • 举报
回复
Use a TIBEvents component to allow your application to register interest in, and asynchronously handle, events posted by an InterBase server.
In essence, the TIBEvents component allows an application to say "I want to be informed when events X, Y and Z occur."When any of the requested events does occur, the InterBase server notifies the application and OnEventAlert is called.
简而言之,TIBEvents 由InterBase server触发,获取异步事件发生的handle.
wildhorse01 2003-01-27
  • 打赏
  • 举报
回复
难道没有人用过TIBEvents?

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧