regional settings problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone help me!
My Date field in Access returns error even with the correct date format
dd.mm.yyyy
Ironically, it works on a windows XP, but not on Windows 2000 server.
Eventhough I have changed this setting from the control panel. Still don't
work from the server. pls help. Below is my code:
--------------------------------------------------------------------------------------------
Option Compare Database
Option Explicit
Dim I As Integer
Dim ODate As String * 8
Dim ACurr(7) As Integer
------------------------------------------------
Public Function Change_Date_Separator(ByVal DDate As String, VID As Integer)
As String

'â ConstDateSep ïðè VID = 0
'è ConstDatePrn ïðè VID <> 0

Dim I As Integer
For I = 1 To Len(DDate)
If (Mid$(DDate, I, 1) = ConstDateSep) Or (Mid$(DDate, I, 1) =
ConstDatePrn) Or (Mid$(DDate, I, 1) = "-") Then
Mid$(DDate, I, 1) = IIf(VID = 0, ConstDateSep, ConstDatePrn)
End If
Next
Change_Date_Separator = DDate
----------------------------------------------------------------------------------------------
 
What is that code supposed to be doing? It looks as though you're trying to
change the data separator in a string, but what are you doing with the
string? Regardless of what your regional settings are, you cannot use dates
in dd/mm/yyyy (or dd.mm.yyyy) format in queries in Access: the date MUST be
in an unambiguous format (yyyy-mm-dd or dd mmm yyyy, for instance) or
mm/dd/yyyy format.

You may find it useful to read Allen Browne's "International Dates in
Access" at http://members.iinet.net.au/~allenbrowne/ser-36.html or what I
have at
http://members.rogers.com/douglas.j.steele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Codenet said:
Can anyone help me!
My Date field in Access returns error even with the correct date format
dd.mm.yyyy
Ironically, it works on a windows XP, but not on Windows 2000 server.
Eventhough I have changed this setting from the control panel. Still don't
work from the server. pls help. Below is my code:
-------------------------------------------------------------------------- ------------------
Option Compare Database
Option Explicit
Dim I As Integer
Dim ODate As String * 8
Dim ACurr(7) As Integer
------------------------------------------------
Public Function Change_Date_Separator(ByVal DDate As String, VID As Integer)
As String

'â ConstDateSep ïðè VID = 0
'è ConstDatePrn ïðè VID <> 0

Dim I As Integer
For I = 1 To Len(DDate)
If (Mid$(DDate, I, 1) = ConstDateSep) Or (Mid$(DDate, I, 1) =
ConstDatePrn) Or (Mid$(DDate, I, 1) = "-") Then
Mid$(DDate, I, 1) = IIf(VID = 0, ConstDateSep, ConstDatePrn)
End If
Next
Change_Date_Separator = DDate
--------------------------------------------------------------------------
--------------------
 
Back
Top