Interbase / Windows 7

Posted on 2011-05-03
Last Modified: 2013-12-09
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.
Question by:Kevinfeening
    LVL 19

    Expert Comment

    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

    Author Comment

    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; := strtodate(ud); := + 1;
    I set (a tDatetimepicker) to the last update + 1 day this is where the error occurs

    Author Comment

    I ran a test on the Client PC

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

    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 ?????
    LVL 19

    Expert Comment

    That's entirely a delphi issue rather than an interbase one

    Author Comment

    So a program that works perfectly well on XP but has an issue with windows 7 is a delphi issue
    why ?

    Author Comment

    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 ????

    Accepted Solution

    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.

    Author Closing Comment

    I checked on the web and found it was a windows 7 bug

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Introduction If you are not already aware of what you could use a table with sequential integer values for in SQL, you can read Delimited String Parsing in SQL Server 2005 or later ( by BrandonGalderisi (h…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now