Recent

Author Topic: Using TDBZVDateTimePicker  (Read 6761 times)

shumphreys

  • Newbie
  • Posts: 2
Using TDBZVDateTimePicker
« on: November 20, 2011, 09:57:14 pm »
Hi,
I have a database-aware app I am building (using MySQL) and Lazarus (FPC 2.4.2).  When using the TDBZVDateTimePicker it connetcs to the DB and displays the right data but the calendar control does not pop up when the button to the right of the control is clicked.  The non-db aware version does have this behaviour.  Is there anything special that needs to be set up for the db-aware version?
Thanks

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Using TDBZVDateTimePicker
« Reply #1 on: November 21, 2011, 12:36:05 am »
Hi,
I have a database-aware app I am building (using MySQL) and Lazarus (FPC 2.4.2).  When using the TDBZVDateTimePicker it connetcs to the DB and displays the right data but the calendar control does not pop up when the button to the right of the control is clicked.  The non-db aware version does have this behaviour.  Is there anything special that needs to be set up for the db-aware version?
Thanks

No, there is nothing special to be set in db-aware version.
I can't reproduce your problem.

Which Lazarus version are you using? Which OS? Which widgetset?
Could you please upload a simple example application which shows your problem? Use this simple database table:
Code: [Select]
CREATE TABLE TABLE1
(
  ID integer NOT NULL,
  DAT date,
  PRIMARY KEY (ID)
)

Insert a couple of records:
Code: [Select]
INSERT INTO TABLE1 (ID, DAT) VALUES (1, '2000-01-01');
INSERT INTO TABLE1 (ID, DAT) VALUES (2, '2001-02-03');
INSERT INTO TABLE1 (ID, DAT) VALUES (3, '2003-12-23');
INSERT INTO TABLE1 (ID, DAT) VALUES (4, '2005-06-14');

shumphreys

  • Newbie
  • Posts: 2
Re: Using TDBZVDateTimePicker
« Reply #2 on: November 22, 2011, 12:31:44 am »
Many thanks. 

I did as you suggested and (of course) it works fine in the sample application :)

Still not in my other one which means I have something wrong there .... It's a while since I did any Db Programming (with Delphi) and so am trying this out with Lazarus for fun.  I am falling over several fundamental errors (which is good as that's how you learn) but it would be useful if anyone can point to an idiot's guide of building a simple Db app (with 3-4 tables) with Lazarus.

Cheers

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Using TDBZVDateTimePicker
« Reply #3 on: November 22, 2011, 03:55:10 am »
Try searching the wiki, there's some good db tutorials there (I remember updating SQLdb Tutorial1, that seemed fairly clear). If they're not sufficient/unclear, post here and tell us what's wrong, maybe I or somebody else can fix the tutorial...

Thanks.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Using TDBZVDateTimePicker
« Reply #4 on: November 23, 2011, 10:52:32 am »
Many thanks. 

I did as you suggested and (of course) it works fine in the sample application :)

Still not in my other one which means I have something wrong there .... It's a while since I did any Db Programming (with Delphi) and so am trying this out with Lazarus for fun.  I am falling over several fundamental errors (which is good as that's how you learn) but it would be useful if anyone can point to an idiot's guide of building a simple Db app (with 3-4 tables) with Lazarus.

Cheers

I found these SQLdb tutorials on wiki pages:

http://wiki.lazarus.freepascal.org/SQLdb_Package
http://wiki.lazarus.freepascal.org/Working_With_TSQLQuery
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial1
http://wiki.lazarus.freepascal.org/SqlDBHowto
http://wiki.lazarus.freepascal.org/MySQLDatabases - this one works with MySQL, which you use.

However, if you have experience with BDE or ADO DB components in Delphi, you might find ZEOS components (http://zeos.firmos.at/) easier to start with than SQLdb.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Using TDBZVDateTimePicker
« Reply #5 on: November 23, 2011, 01:24:14 pm »
If SQLDBTutorial1 doesn't work with mysql, please update it until it does  :D

I think one of the problems with the wiki pages is that there's a lot of emphasis on the differences between the databases, while it could be better to show there's a Lazarus/sqldb way of doing things where there are minor differences between the products.
I suspect newbies (including myself) will think you will need to relearn everything/do everything differently when using a different database.

After all, what's the use of an abstraction library if you only notice the differences of the underlying subsystems  ;)

Ok. Rant over, I feel better  :)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018