• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1021
  • Last Modified:

Interbase / Windows 7

1..  A client is running Windows 7 Professional Service pack 1 with interbase 7.5
The regional options for short date format is set to DD/MM/YYYY but every time I run a Delphi program an error 30/04/2011 is an invalid date format what would be causing this

2.. Also any program with the word update won't run e.g PayoutUpdate.exe will not run how can I override this.
0
Kevinfeening
Asked:
Kevinfeening
  • 6
  • 2
1 Solution
 
NickUpsonCommented:
1. interbase doesn't use the regional options, the date format needs to be controlled by delphi or the user, your example should work as 30-04-2011

2. no idea sorry, you might do better making 2 seperate questions
0
 
KevinfeeningAuthor Commented:
Sorry I thought it Did
The program is set up as follows

tControl.findkey(['PK']);  // Interbase Table called control with index of PK

 if tControl.fieldbyname('Udate').asString <> '' then begin
// Field UDate is the last date updated and is 30/04/2011
     ud := tControl.fieldbyname('Udate').asString;
     tpDate.date := strtodate(ud);
     tpdate.date := tpDate.date + 1;
  end;
I set tpDate.date (a tDatetimepicker) to the last update + 1 day this is where the error occurs
0
 
KevinfeeningAuthor Commented:
I ran a test on the Client PC

procedure TForm1.Button4Click(Sender: TObject);
var dt : string;
begin
  dt := '01/04/2011';  // dd/mm/yyyy format
  tpDate.date := strtodate(dt);
  tpDate.date := tpDate.date + 1;
end;

the date should be 02/04/2011 but showed as 04/02/2011 which is MM/DD/YYYY format not the DD/MM/YYYY thats why 30/04/2011 would show as an error it is trying to display as 04/30/2011
if this worked OK in XP there must be somewhere to set to format in Windows 7 ?????
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
NickUpsonCommented:
That's entirely a delphi issue rather than an interbase one
0
 
KevinfeeningAuthor Commented:
So a program that works perfectly well on XP but has an issue with windows 7 is a delphi issue
why ?
0
 
KevinfeeningAuthor Commented:
Note - I also ran the same program on my sons Windows 7 Professional and it worked correctly
the only difference I can find is that his PC isn't service pack 1 ????
0
 
KevinfeeningAuthor Commented:
Thanks for you info I checked the web again and found this in delphipages

The problem is in Windows 7, even though the regional settings are set
to dd/mm/yyyy it still displays in my program as mm/dd/yyyy
I have seen many other people post the same question on other sites.
What worked for me is going into regional settings and changing to a
different region other than yours. Click Apply.
Go back and change it back to your region click Apply.
This seems to make it work.
0
 
KevinfeeningAuthor Commented:
I checked on the web and found it was a windows 7 bug
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now