Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autogenerated Numbers in Delphi, SQL server

Status
Not open for further replies.

kagee

Programmer
Apr 21, 2004
30
NL
Am very very new to delphi and am currently trying to make a simple app.

I need to have an autogenerated client identification number that will automatically increment on every new record.(more like an auto-generated index )

I have no idea how to do this.

Also how do i code for my menu items to ensure that:
1. If a given form is open, if one clicks on the menu item, the form is brought to focus and not reloaded.

2. How do i code for a 'windows' menu is automatically updated with the names of the open forms and if u click on any of the forms, its brought to focus.

Please assist.

Kagee

(Starter Delphi programmer)
 
Hi,

If you are using SQL Server, you can have your ID numbers autogenerated by the database.

In the table design in SQL Server set the 'Identity' property of the column you want to auto increment to Yes. Every time a record is inserted this number will then increment.

Not sure how to implement you other problem though.



There are two ways to write error-free programs; only the third one works.
 
Kagee: The open windows list is automatic. Look up the .WindowMenu property of TForm (TCustomForm) in the help file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top