1. Rômulo Sorato
  2. PowerBuilder
  3. Wednesday, 6 November 2019 19:47 PM UTC

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?

Accepted Answer
Rômulo Sorato Accepted Answer Pending Moderation
  1. Thursday, 7 November 2019 11:00 AM UTC
  2. PowerBuilder
  3. # Permalink

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
  1. Armeen Mazda @Appeon
  2. Thursday, 7 November 2019 16:27 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 6 November 2019 20:55 PM UTC
  2. PowerBuilder
  3. # 1

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.
  • Page :
  • 1


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