Recent

Author Topic: Data type checking on Lazarus  (Read 5524 times)

mrjcampbell

  • Newbie
  • Posts: 2
Data type checking on Lazarus
« on: December 06, 2006, 08:33:59 pm »
Hello, long time Kylix user here having a first play with Lazarus. All looks extremely pretty and unlike Kylix it doesn't hang when I try to add a new form, BUT...

Data being retrieved from the database is checked for type. Lazarus gets very unhappy with blank database fields and tells me that '' is not a valid integer. Kylix simply ignores blank fields. While the Lazarus approach is strictly correct it is a bit of a nuisance for my purposes. My database tables are peppered with blank fields sometimes for a good reason and it would be a huge job to go through two years of records filling in dummy data.

So my question is this:  is there any way to turn the data type checking off so that Lazarus simply displays a blank field in the same way as Kylix?

Thanks
John C

RudieD

  • Full Member
  • ***
  • Posts: 234
RE: Data type checking on Lazarus
« Reply #1 on: December 07, 2006, 02:03:14 pm »
What database are you using, and what database components ?
The FRED Trainer. (Training FRED with Lazarus/FPC)

mrjcampbell

  • Newbie
  • Posts: 2
Data type checking on Lazarus
« Reply #2 on: December 07, 2006, 03:29:42 pm »
I'm using Postgresql (7.3 I think)

For development I'm currently using Kylix 3 on Mandrake 10.1 with a database driver by VitaVoom.

I've only had a very brief play around with Lazarus - connecting with the PSQL database and PSQL dataset components which I assume to be roughly analgous to TSQLconnection and TSQLdataset in Kylix.

Some of the tables in the database have no value posted to them. For example the "payments" table (which records payments to staff) has a field for national insurance payments (It's a UK tax). If the employee's pay is below a certain level then the correct value for this field is not "0" it is left blank.

Kylix doesn't seem to have a problem with recalling records which have empty fields in, but Lazarus gives an error message

'' is an invalid float.

Strictly correct of course, but not helpful for my purposes.

I would like to move to Lazarus as Kylix has some fairly annoying faults, but the thought of trawling through several tens of thousands of records to replace blank fields doesn't appeal! If there's some way to suspend type checking when the records are retrieved from the database I'd be grateful to hear of it.

Thanks for any help

 

TinyPortal © 2005-2018