Solved

datawindow object question from powerbuilder 9

Posted on 2004-10-06
4
510 Views
Last Modified: 2013-12-26
i created a datawindow object called 'd_custlist'
i created a window called 'showme'
i created a datawindow control on the window and attached to it the datawindow object.

when i login to the database the form shows up but none of the data showed.
it just shows me the headers i created when i paint the object.

help please...anyone knows what i have to do to see the results on the datawindow control on the form?
0
Comment
Question by:stefanosn
  • 3
4 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12236526
did you call
dw_1.settranobject(sqlca)
dw_1.retrieve()
0
 
LVL 33

Accepted Solution

by:
sajuks earned 125 total points
ID: 12236537
From the PB Help File

SQLCA.DBMS = ProfileString("myapp.ini", &
        "Database", "DBMS", " ")

SQLCA.DbParm = ProfileString("myapp.ini", &
        "Database", "DbParm", " ")

// Connect to database

CONNECT USING SQLCA;

// Test whether the connect succeeded

IF SQLCA.SQLCode <> 0 THEN
        MessageBox("Connect Failed", &
            "Cannot connect to database." &
            + SQLCA.SQLErrText)

        RETURN

END IF

Open(w_main)

To continue the example, the open event for w_main sets the transaction object for the DataWindow control dw_main to SQLCA and retrieves rows from the database. If no rows were retrieved or if there is an error (that is, the return value is negative), the script displays a message to the user:

long ll_rows

dw_main.SetTransObject(SQLCA)

ll_rows = dw_main.Retrieve()

IF ll_rows < 1 THEN MessageBox( &

        "Database Error", &

        "No rows retrieved.")
0
 

Author Comment

by:stefanosn
ID: 12236633
ok it worked!:)
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12245302
Thanks for the points and grade
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now