Results 1 to 7 of 7

Thread: vb6 project exe not working properly on remote computer.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    23

    vb6 project exe not working properly on remote computer.

    i have made exe file of my project it runs fine on my computer (where my database sql server 2008 is installed), but when we run same exe file from remote computer it works but not giving proper results. for example as under.

    on my computer when we print a report it gives date on the report as "Oct 3, 2013" while from the remote computer same date is being shown as "Mar 10, 2013". Can any body help.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: vb6 project exe not working properly on remote computer.

    Sounds like the machines have different locale settings

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    23

    Re: vb6 project exe not working properly on remote computer.

    Quote Originally Posted by DataMiser View Post
    Sounds like the machines have different locale settings
    let me explain little more as under.

    i have a file project.exe, it runs perfectly on my computer where my database is also available.
    same project.exe is available on my collegue's computer but when he runs, it shows incorrect date on a Datareport.

  4. #4
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: vb6 project exe not working properly on remote computer.

    i had this isuue before
    locale settings
    excatly what DM said

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: vb6 project exe not working properly on remote computer.

    The locale determines how dates are used in one locale 10/3/2013 would be Oct 3rd in another locale would be Mar 10th which is what you are seeing

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: vb6 project exe not working properly on remote computer.

    It isn't the dates that are a problem, since the Date type is universal. The problem comes with casual or sloppy (i.e. implicit) conversions between String representations of dates and actual binary Date data.

    There are two possible solutions to this:

    • Always use binary data interchange formats.
    • Always use a fixed locale (such as the "Invariant Locale") for text data interchange formats.


    VConvert, A Class for Locale-Specific Data Conversions offers one easy way to accomplish the latter.


    The idea is that locally (in each program) you can fuss and fidget all you want flippity-flopping between text and binary dates. Then when you need to transmit a binary date value as text to another computer, the sender uses:

    Code:
    Private VC As VConvert
    ...
    
    Set VC = New VConvert
    VC.LCID = LOCALE_INVARIANT 
    ...
    
    ... get dtSomeDate from somewhere in your program ...
    strSomeDate = VC.Convert(dtSomeDate, vbString)
    ... send strSomeDate...
    And the receiver uses:

    Code:
    Private VC As VConvert
    ...
    
    Set VC = New VConvert
    VC.LCID = LOCALE_INVARIANT 
    ...
    
    ... receive strSomeDate...
    dtSomeDate = VC.Convert(dtSomeDate, vbDate)
    ... use dtSomeDate for something in your program ...
    This way the String value sent "over the wire" always travels in the same (Invariant) format. Each end can convert between binary Date values and these String values.


    Note that other data types have similar issues:

    True and False have different names in other languages. The decimal point in a number is a comma in some locales.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    23

    Re: vb6 project exe not working properly on remote computer.

    Dear All,

    Thanks for your help, the problem was of locale settings.
    i have resolved with your kind help.
    I am grateful to you all of you.
    best regards.
    Imran Khaldi

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width