-
Oct 3rd, 2013, 01:40 AM
#1
Thread Starter
Junior Member
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.
-
Oct 3rd, 2013, 01:44 AM
#2
Re: vb6 project exe not working properly on remote computer.
Sounds like the machines have different locale settings
-
Oct 3rd, 2013, 02:13 AM
#3
Thread Starter
Junior Member
Re: vb6 project exe not working properly on remote computer.
Originally Posted by DataMiser
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.
-
Oct 3rd, 2013, 02:31 AM
#4
Enjoy the moment
Re: vb6 project exe not working properly on remote computer.
i had this isuue before
excatly what DM said
-
Oct 3rd, 2013, 08:45 AM
#5
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
-
Oct 3rd, 2013, 09:22 AM
#6
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.
-
Oct 3rd, 2013, 11:46 PM
#7
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|