Link to home
Start Free TrialLog in
Avatar of scotdance
scotdanceFlag for United Kingdom of Great Britain and Northern Ireland

asked on

DateTimePicker problems

Hi,
I've got a problem with the standard DatetimePicker in Delphi.

On some PC's where my app is ran I get the following error:
'Failed to set calendar date or time'

These machines are running windows XP and connecting to an SQL Server database, although on some of the other XP pc's connecting to the same database it works fine.

As this error does not happen on my PC which is running Win2K with Delphi7 I cannot catch where it is going wrong.  So I have put messages into the forms create and show to try and catch it but it is not getting to the form show event messages.

I am opening the form with following code if that helps anyone:
  frmDate := TfrmDate.create(self);
  ShowMessage('Main1');
  frmDate.showmodal;
  ShowMessage('Main2');
  frmDate.Free;

Also tried making a small app which calls a window with a datetimepicker on it and it works fine on all the pc's.

Has anyone ever saw this error or know a fix for it?

Thanks
Avatar of geobul
geobul

Hi,

Check Windows regional settings of date/time. Perhaps the computers giving that error have different setting compared to your computer (and other XPs where the program runs OK). I suppose that you're setting/getting date/time database fields not considering possible different regional settings somewhere (i.e. hardcoded date/time format or so).

Regards, Geo
Avatar of scotdance

ASKER

Hi,

All the computers are set to the same region which is UK,
And the datepickers are not connected to a database, I am just setting their values to the current date, as their dates are passed into a sql search script I have to do.

thanks,
Hey
It appears we may have found the problem here, the XP machines that it did not work on did not have SP2 on them, and once we upgraded them it worked fine, it appears that it was the comctl32.dll that was causing all the problems.

Sorry to have wasted your time.

Thanks for your help anyway
Further note we have also discovered that if you have an 'XPManifest' component in your project that might be another cause of this problem.

Thanks Again
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial