Solved

TDBDateTimePIcker

Posted on 2004-08-01
3
742 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 250 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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