Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TDBDateTimePIcker

Posted on 2004-08-01
3
Medium Priority
?
780 Views
Last Modified: 2008-01-09
I Need Help Please ,

I am writing a DB program for Workshop Bookings,I am using ADO and D7.How do i link the DBDatePicker to a DB Grid that when you select a new date the DBGrid will display the selected date details only so that new details can de added/Edited on the selected date
0
Comment
Question by:faizsnell
3 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 11688459
0
 
LVL 12

Accepted Solution

by:
esoftbg earned 500 total points
ID: 11689652
example from:
page:        http://www.geocities.com/esoftbg/
  link:        Q_21078424.zip

//........

uses
  ...., DateUtils;

procedure TForm1.ADOQueryLISTNewRecord(DataSet: TDataSet);
begin
  ADOQueryLIST.FieldByName('MOMENT').AsDateTime := Today;
end;
0
 
LVL 2

Expert Comment

by:DarkCore_
ID: 11691490
Let the user choose the date anywhere in your project

I think you can do the following. Use an ADOQuery to retrieve the values, for example, "SELECT .... WHERE Date = :Date", where param "Date" should be the date selected

Then, when user inserts new record, you can assign the new date to your field, if you control it manually:
   .....
   mydataset.insert;
   mydataset.fieldbyname('date').AsDateTime := choosendate;
   ....

or automatically in the "AfterInsert" event of ADOQuery

Of course, if you use DBGrid you can set the column with the "Date" field readonly.

Edu
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Integration Management Part 2
Suggested Courses

971 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