oracle forms9 application

 Creating a customized sign-on form to login a database to be choiced.

 

This design can be implemented with the following steps

1.        create a control block named   CTRL_BLK  :

 two text items   : USERNAME and PASSWORD; 

a pop-up list    : DATABASE__STRING

two push buttons :PB_LOGIN and PB_QUIT.

2. ON-LOGIN trigger code is as follows:

declare

ret_err_code number;

ret_err_text varchar2(1000);

begin

p_logon(:ctrl_blk.username,

    :ctrl_blk.password,

    :ctrl_blk.database_string,

    ret_err_code,

    ret_err_text);

     if (ret_err_code<>0)then

message(‘error’);

          p_show_alert(ret_err_text);

return;

    end if ;

end ;

 

2         The code for p_logon is as follows:

procedure p_logon(un varchar2,

                pw varchar2,

                dcs varchar2,

                o_err_code out number,

                o_err_text out varchar2)

 is 

 v_err_code number;

 v_err_text varchar2(1000);

begin

    if dcs is not null then

    logon(un,pw||’@’||dcs,false);

      if not form_success then

  message(‘not form_success’);

  v_err_code:=dbms_error_code;

v_err_text:=dbms_error_text;

 message(v_err_text);

    end if;

else 

      logon (un,pw,false );

 if not form_success then

v_err_code:=dbms_error_code;

v_err_text:=dbms_error_text;

     end if;

 end if;

o_err_code:=v_err_code;

o_err_text:=v_err_text;

 end ;

4.        The WHEN-BUTTON_PRESSED trigger for the Login Button would consist of the following :

begin

if form_success then

logon( :ctrl_blk.username,

:ctrl_blk.password ||’@’||:ctrl_blk.database_string,false);

 call_form(‘e:\lianxi\2-lianxi\budgeting’,no_hide);

end if;

end

Advertisements
此条目发表在未分类分类目录。将固定链接加入收藏夹。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s