PB数据管道的实用程序设计技术 2001-01-26 00:00:00·
王晓学·YESKY
上一页 1 2 3 4 5 6 下一页 二、执行数据管道初始化操作
执行初始化操作步骤:
(1)连接管道操作的源数据库和目标数据库。
首先在窗口w_yz_pipeline声明事务对象database_source和database_destination
连接数据库脚本如下:
//连接源数据库
database_source=Create transaction
// 为database_source 对象属性赋值
。。。
//连接语句
Connect using database_source;
//判断是否成功
if database_source.SQLCode $#@60;$#@62; 0 then
beep(1)
MessagBox(“系统出错:”,“源数据库连接错误”, Exclamation!)
Halt
End if
//连接目标数据库
database_destination=Create transaction
// 为database_ destination 对象属性赋值
。。。
//连接语句
Connect using database_ destination;
if database_destination.SQLCode$#@60;$#@62;0 then
beep(1)
MessagBox(“系统出错:”,“目标数据库连接错误”, Exclamation!)
Halt
End if
(2)创建支撑用户对象实例。
//首先声明变量iuo_pipe_exchange:
u_pipe_exchange iuo_pipe_exchange
然后再在uevent_pipe_setup用户事件中创建u_pipe_exchange的实例并赋值给iuo_pipe_exchange变量:
iuo_pipe_exchange=CREATE u_pipe_exchange
(3)定义需使用的特定管道对象,即在相应事件脚本中把某一管道对象的字符串赋给支撑用户对象实例的DataObject属性值。本例中使用了两个不同的管道对象:pipe_user_table01和pipe_user_table02。Cb_start命令按钮的事件操作根据单选按钮的值来决定启动哪个管道对象进行操作,代码为:
if rb_create.checked=true then
iuo_pipe_exchange.dataobject=’pipe_user_table01’
else iuo_pipe_exchange=’pipe_user_table02’
end if
上一页 1 2 3 4 5 6 下一页 |