Results 1 to 6 of 6

Thread: Needing Help

  1. #1
    Join Date
    Apr 2006
    Posts
    1
    Rep Power
    0

    Default Needing Help

    Ok, so im a student at 6th form college doing cComputing and for our major coursework we need to create a program that allows me to manage a town halls booking system.

    Basically I have the form, I have the 'DateTimePicker' and a DBGrid. Basically Id like to be able to choose a date from the DTP and show bookings on that day on the DBGrid. I have the information on an Excel spreadsheet but Ive forgotten how to link the DTP with the DBGrid. I know it's got something to do with a Data Module and an ADOConnection, DataSource and ADO DataSet.

    Can someone please please send me in the right direction?

    Thanks.

  2. #2
    Join Date
    Mar 2003
    Posts
    492
    Rep Power
    0

    Default

    The DateTimePicker is a Non-DB Aware control. You would have to use it's OnChange event to manually filter your database to retrieve the values that correspond the controls current date.

  3. #3
    Join Date
    Sep 2004
    Posts
    281
    Rep Power
    0

    Default

    Quote Originally Posted by Blunty Killer
    The DateTimePicker is a Non-DB Aware control.
    To help you identify the components mentioned above; delphi data aware components "NORMALY" have a "DB" in there name example "DBlookup"
    Check the link below for example application managing excel with Delphi.


    http://delphi.about.com/library/code/ncaa090903a.htm

  4. #4
    Join Date
    Mar 2003
    Posts
    492
    Rep Power
    0

    Default

    what he wants to do will have to be done via the onchange event of the datetimepicker (not a db-aware control). if he is using a query, all he needs to do is to rebuild the query and send it to the server with the condition (WHERE CLAUSE) filtering out the new date. he could also set the filter of the underlying dataset for the date field to match the new date.

  5. #5
    Join Date
    Sep 2004
    Posts
    281
    Rep Power
    0

    Default

    Quote Originally Posted by Yppolitia
    I have the information on an Excel spreadsheet but Ive forgotten how to link the DTP with the DBGrid. I know it's got something to do with a Data Module and an ADOConnection, DataSource and ADO DataSet.
    Thanks.
    After reading, what he had posted; the lines in the quotes gave me the impression that he needed to know
    A) How to connect the grid with his data source (Excel).
    B) How to use hit DTP to get at the information in his data source to display the required records.

    I found the example in the link I mentioned useful and felt it might help him.
    That said. I know your saying the onChange event is the place to get at his data, but he would need to connect to it first?

    If he already has a connection to his excel file(data source ) then cool. Your suggestion is ok. Other wise he needs to connect.
    Last edited by Artificial_Intelligence; Apr 30, 2006 at 05:41 PM.

  6. #6
    Join Date
    Mar 2003
    Posts
    492
    Rep Power
    0

    Default

    Quote Originally Posted by Yppolitia

    Basically I have the form, I have the 'DateTimePicker' and a DBGrid. Basically Id like to be able to choose a date from the DTP and show bookings on that day on the DBGrid.
    Thanks.
    Getting the connection to Excel is the easy part. What seems to be bugging him is connecting the DateTimePicker to the Dataset and showing the records for which the selected Date is relevant, and displaying them in the grid. But because it is not a DB Aware control he would have to write a custom event handler for the onchange event.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •