?
Solved

powerbuilder datawindow identity fields

Posted on 2009-05-06
4
Medium Priority
?
1,946 Views
Last Modified: 2013-12-26
i am using a datawidow to deal with a table which contains a identity field. i dont care to show this field on the screen but i want this field to auto-increment its value by one when i insert a new record to the database. How can i deal with this field in design time? And what about the update properties of the datawindow?

if i dont include it in the sql statement ( i believe this is the right thing to do) will this field increase its value by one every time i add a new record? In case that i would like to display this field in the screen but not update it thru keyboard what should i do?

i would like something else too. (not concerning identity fields). suppose we execute the command dw_1.update() . can we get at run time the exact command that powerbuilder sends to the database? Suppose this datawindow has a field named xx with tab order 10. how can i change it to 0 in run time?

i am using pb 11.5 and sql server 2000

0
Comment
Question by:basilhs_s
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
diasroshan earned 2000 total points
ID: 24313683
Hi,

You can include the identity column in the SQL of your datawindow.
In the update properties, dont select the identity column in the updateable columns section.
So now u can display the column aswell.

DW_1.GetSQLPreview ( )
This will give u the sql sent to the database.
Also, have a look in PB Help at SQLPreview Event of DW.

At runtime to change the taborder,
dw_1.Object.emp_name.TabSequence = 0
or,
dw_1.Modify("emp_name.TabSequence = 0")

Cheers,
Rosh
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 24313865
Hi,

Also, forgot to mention,
In update properties, there is a dropdown to select the identity column.Please select your identity column from there.

In the above post i have asked not to select the identity column in the updateable columns section. Try selecting it and see if its giving any noteable issues.

Cheers,
Rosh
0
 

Author Comment

by:basilhs_s
ID: 24318796
thanks for the reply. it seems that its correct. i ll check it tomorrow morning
0
 

Author Closing Comment

by:basilhs_s
ID: 31578356
thanks very much
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

741 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