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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search and navigate through a table

Status
Not open for further replies.

cuterita7

Programmer
Apr 8, 2008
10
GB
Hi
I am newbie in Delphi so I want to ask what should I use for this:
I want to make a VCL Form that asks the user(userinput) to enter the RefCode(Refcode is the primary key of the table),if the entered code is valid then the corresponding record is displayed in TEdit controls,Also in my form I have MoveFirst,MovePrevious,MoveNext,MoveLast buttons that navigate the user through all the records.
I am not asking anyone to do my task only I am asking from where should I begin,Which controls should I use...
Any help please
 
Since you are working with tables, use the Data Controls

For editing the data, use TDBEdit
For read-only use TDBText
For scrolling the table (next, previous, last etc..) use a TDBNavigator

In the FAQ area, there are some examples about database programming

Regards


Steven
 
thanks for your reply but what if I have a toolbar with 4 buttons and I want to navigate through the table using this toolbar,in VCL forms you can not use the databinding nor the currencymanager in order to navigate through the records in a table.
do you have any suggestion?
thanks
 
in VCL forms you can not use the databinding nor the currencymanager
???

I am afraid I don't understand this, there is a FAQ, where I have used a combobox, an editbox and a button to search in a table or query. This is just an example, in my real world application I use these components (and more) on a toolbar in various database forms.
Another workaround is to place all these components on a frame, with code and all.
Also a good book on Delphi, will get you up to speed.


You are new to Delphi, don't know if you come from M$ VB, but others already have pointed out to use database components, if you want to re-invent the wheel, the choice is up to you.

Steven
 
cuterita7, are you referring to VCL.NET?

what delphi version do you have?

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
No I am not to with that #, .NET hype, Borland has gone the micro$oft way of releasing every year a new version...

I come from Turbo Pascal - Delphi3, 4, 6 and recently Delphi 2007 (codegear they call it now)

Steven
 
well I am using VCL Form delphi.net and I want to re-ask my question:
I have a table that I want to show its records on a VCL form (Delphi.Net) and I have a toolbar that contains 4 buttons that I will use to navigate through the records of the table.I don't want to use the DBNavigator because i am obliged to use this toolbar,I tried the databindings and the currencymanager but it didn't work for VCL form Delphi.Net,it works for windows form.
please can u give me the solution to that problem?what should I use?
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top