retrieve datawindow's text button.

1
0
-1

Hi Everyone,

 

I have created a window in which inserted a datawindow and in Datawindow i have added text ,texboxes.

But when I am running the application window is showing blank datawindow.

I have used the below code :

long l1_rows
 
dw_1.setTrans(sqlca)
l1_rows=dw_1.retrieve()
if l1_rows < 1 then
dw_1.insertrow( 0)
end if
 
windowstate = maximized!
 
 
PS: How can i attach image in this Q/A so that i can project my question in a more correct manner.

 

Question Tags: 

Answers

Marco Meoni answered retrieve datawindow's text button.

1
0
-1

Hi Radha,

  • Did you properly connect to the database?

SQLCA.DBMS = "ODBC"
SQLCA.DBParm = "ConnectString='DSN=PB Demo DB V2017R2;UID=dba;PWD=sql'"
Connect using sqlca; // sqlca.sqlcode must returns 0, which means connection established

  • Did you assign the dataobject to the datawindow control at design time? If not, you are missing

dw_1.DataObject = ‘d_yourdataobject’

  • Instead of SetTrans, use the SetTransObject method to specify the transaction object. It is more efficient 
  • Last but not lest, you must have columns in you dataobject. “text” and ”textboxes” are not enough when you execute InsertRow() 

Best,

Marco

Roland Smith answered retrieve datawindow's text button.

1
0
-1

First you should use SetTransObject instead of SetTrans.

If it works when run from the IDE but not from an exe, the likely cause is that the DataWindow object was not included in the exe by the compiler. You need to create a .PBR file listing the DataWindow objects that are assigned in code.

A .PBR file is a text file that lists image files and DataWindow objects like this:

libraryname.pbl(d_mydatawindow)