Kamis, 25 September 2008

Happy Ied Day 1429 H



Minal Aidzin Wal Faidzin, Please
Forgive all of my mistakes with all your heart, and we will be meet again after ied holliday with many script in SCRIPTROOM blog

Selasa, 23 September 2008

Power Builder - Script for using Horizontal ProgressBar Control

If you want to use Horizontal ProgressBar Control for many process, you can following this sintax
hpb_1.SetRange(0, li_row)
hpb_1.SetStep = 1
ll_start = cpu()
for i = 1 to li_row
hpb_1.offsetpos(1)
st_100.Text = string(round( i / li_row * 100, 0) ) + '%'
............ ( sintax )
............ ( sintax )
ll_used = cpu() - ll_start
st_time.Text = string( RelativeTime(Time(0,0,0), ll_used / 1000), 'hh:mm:ss')
next

Power Builder - Get Current Directory

We can get current active directory of application , the output of variable is string.
string ls_temp
ulong lul_value
boolean lb_rc

lul_value = 255
ls_temp = space(255)
lb_rc = GetCurrentDirectoryA( lul_value,ls_temp)
If lb_rc Then sle_path.text=ls_temp

Senin, 22 September 2008

Power Builder - Using Enter For Change Column Pointers


if you want to be use enter to change pointer for every each column you can use even rowenter in data windows and then you can using this script :
Send(Handle(This), 256, 9, Long(0, 0))
Message.Processed = TRUE
Message.ReturnValue = 1

Power Bulider 7 - Manage Database Console





you can use profile ( native / odbc) to connect database and then manage table to create / modify evey each property of tables

Power Builder - Adding Table for ASA Database

//===adding table for ASA database=======
select count(*) into :li_table from systable where table_name = upper('saldo_rekmtr');

if li_table = 0 then
ls_add = 'CREATE TABLE "dba"."saldo_rekmtr" ' +&
'("kd_unit" char(5) NOT NULL DEFAULT NULL,' +&
'"rek" varchar(9) NOT NULL DEFAULT NULL, ' +&
'PRIMARY KEY ("kd_unit"")) ;'
execute immediate :ls_add;
ls_idx = 'CREATE UNIQUE INDEX "idx_saldorekmtr" ON "dba"."saldo_rekmtr" ' +&
'("kd_unit") ;'
execute immediate :ls_idx;
end if

Power Builder - Adding Table Sintax

//===if using oracle you can use this sintax for adding table===
Select count(*) Into :ll_adabaris from user_tables
Where lower(table_name) = 'debitur' ;
IF sqlca.sqlcode = 100 or ll_adabaris = 0 Then
ls_sql = "create table sample_b.debitur (kar_nik char(6) not null, kd_kredit char(5) not null, no_setuju varchar2(25) not null, tgl_setuju date, keterangan1 varchar2(25)," +&
"primary key ( kar_nik, kd_kredit, no_setuju ))"
Execute immediate :ls_sql ;
IF sqlca.sqlcode <> 0 Then
Beep(1)
MessageBox('Information', "must add table...")
Return
End IF
End IF

Today For All

Today I will begin write about all of my experiences of carrying out the production of the application by using the programming language that was involved in by me from the start of me began to at this time. this blog will contain about production discussions of the application of the based programming power builder or other, i hope this writing could use for the world and was useful to world goodness to help all humankind so that this life is better and useful. Special thanks for my whole friend who was support for All this became the reality..

Power Builder - MySQL connectiom Database Sintax

// Profile connection with MYSQL Database sintax
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = false
SQLCA.DBParm = "ConnectString='DSN=sdmlocal;UID=root;PWD=mount8860;OPTION=135168',DisableBind=1,StaticBind=0,PBUseProcOwner=NO"

Minggu, 21 September 2008

Power Builder - Oracle Database Connection Sintax

The oracle ('big size') database can connect with native, we can using two ways to connection as i know off course
// Profile

SQLCA.DBMS = "O84 ORACLE 8.0.4"
SQLCA.LogPass = 'password'
SQLCA.ServerName = "server"
SQLCA.LogId = "hrd1"
SQLCA.AutoCommit = False
SQLCA.DBParm = "PBCatalogOwner='hrd1'

//Profile using INI file setting
SetPointer(HourGlass!)
SQLCA.DBMS =ProfileString("XXX.INI","Database","DBMS", " ")
SQLCA.Database =ProfileString("XXX.INI","Database","DataBase", " ")
SQLCA.LogID =ProfileString("XXX.INI","Database","LogID", " ")
SQLCA.LogPass =ProfileString("XXX.INI","Database","LogPassword", " ")
SQLCA.ServerName =ProfileString("XXX.INI","Database","ServerName", " ")
SQLCA.UserID =ProfileString("XXX.INI","Database","UserID", " ")
SQLCA.DBPass =ProfileString("XXX.INI","Database","DatabasePassword", " ")
SQLCA.Lock =ProfileString("XXX.INI","Database","Lock", " ")
SQLCA.DbParm =ProfileString("XXX.INI","Database","DbParm", " ")
connect;

if sqlca.sqlcode <> 0 then
messagebox("Error Connection",sqlca.sqlerrtext)
exit
else
open(w_login)
end if

XXX.ini ( INI file)
[siop]
DBMS=O84 ORACLE 8.0.4
Database=
UserId=
ServerName=server
LogId=hrd1
Lock=
DbParm=PBCatalogOwner='hrd1'