1. Rômulo Sorato
  2. PowerBuilder
  3. Wednesday, 06 November 2019

Hello.

PB is crashing when i update a datastore:

 

 

lds_example = CREATE ds_example 
lds_example.SetTransObject(SQLCA)
llrow = lds_example.insertRow(0)
lds_example.setItem (llrow,"codi_emp",auo_emp.llcodi_emp)
lds_example.setItem(llrow,"competencia",this.ldcompetencia)
lds_example.setItem(llrow,"i_empregados",auo_emp.lli_empregados)
lds_example.setItem(llrow,"i_eventos",this.EV_COD)
lds_example.setItem(llrow,"prov_desc", lds_evento.getItemString(1,"prov_desc"))
lds_example.setItem(llrow,"valor_inf",this.HORAS_MES)
lds_example.setItem(llrow,"valor_calc",this.ldvl_calc)

if lds_example.update() = 1 then
	commit;	
else
	rollback;
	MessageBox("Erro", "Erro ao gravar resultado do calculo.", stopSign!)
end if

What could it be?

Who is viewing this page
Accepted Answer
Rômulo Sorato Accepted Answer Pending Moderation
0
Votes
Undo

The problem is with interactive sql.

I forget to commit the changes i´ve been made.This cause pb to crash when update database.

Comment
Thanks for sharing the solution!
  1. Armeen Mazda
  2. Thursday, 7 November 2019
There are no comments made yet.
  1. Thursday, 7 November 2019
  2. PowerBuilder
  3. # Permalink
John Fauss Accepted Answer Pending Moderation
0
Votes
Undo

Shouldn't you instead start out your code:

DataStore lds_example

lds_example = CREATE DataStore
lds_example.DataObject = 'd_datawindow_objectname'
lds_example.SetTransObject(SQLCA)
   .
   .
   .

Don't forget to DESTROY the DataStore when you are done with it.

DESTROY lds_example

Regards,
John

Comment
There are no comments made yet.
  1. Wednesday, 6 November 2019
  2. PowerBuilder
  3. # 1
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.