Newsgroup: it.comp.appl.access
Titolo: Separatore delle migliaia e dei decimali di windows

Salve a tutti,
Qualcuno conosce un modo (che ne so' un API di windows) per sapere se
vengono usati la virgola per come separatore delle migliaia ed il punto come
separatore dei dedimali,
ed eventualmente modificarli da codice in apertura del database ?
Grazie a tutti :)
Ciao Lorenzo
--
 
http://www.arsdata.it

 ed eventualmente modificarli da codice in apertura del database ?
Si. Due anni fa l'ho discutato con Dev.
Puoi copiare il codice in un modulo e chiamare la funzione
"Locale_Aendern" per cambiare il separatore.
--
HTH
Karl
*********
Access-FAQ (tedesco): 
http://www.donkarl.com
'-----------
' changes decimal separator
' major parts of the code by Dev Ashish and Terry Kreft
' minor parts and adaptation by Karl Donaubauer 15.4.99
Public Const LOCALE_SDECIMAL = &HE          '  decimal separator
Public Const LOCALE_STHOUSAND = &HF         '  thousand separator
Public Const LOCALE_SMONDECIMALSEP = &H16   '  monetary decimal separator
Public Const LOCALE_SMONTHOUSANDSEP = &H17  '  monetary thousand separator
Public Const LOCALE_SYSTEM_DEFAULT& = &H800
Public Const LOCALE_USER_DEFAULT& = &H400
Const cMAXLEN = 255
Private Declare Function apiGetLocaleInfo Lib "kernel32" _
    Alias "GetLocaleInfoA" _
    (ByVal Locale As Long, _
    ByVal LCType As Long, _
    ByVal lpLCData As String, _
    ByVal cchData As Long) _
    As Long
Private Declare Function apiSetLocaleInfo Lib "kernel32" _
    Alias "SetLocaleInfoA" _
    (ByVal Locale As Long, _
    ByVal LCType As Long, _
    ByVal lpLCData As String) _
    As Long
Private Const HWND_BROADCAST& = -1
Private Const WM_WININICHANGE& = &H1A
Private Const SPIF_UPDATEINIFILE = &H1
Private Const SPIF_SENDWININICHANGE = &H2
Private Declare Function apiSendMessageLong Lib "user32" _
    Alias "SendMessageA" _
    (ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByVal lParam As Long) _
    As Long
'-----------
Function fLocaleInfo(lngLCType As Long) As String
Dim lngLocale As Long
Dim strLCData As String, lngData As Long
Dim lngX As Long
    strLCData = String$(cMAXLEN - 1, 0)
    lngData = cMAXLEN
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, lngLCType, _
                    strLCData, lngData)
        If lngX <> 0 Then
        fLocaleInfo = Left$(strLCData, lngX - 1)
        End If
End Function
'-----------
Function LocaleInfoSet(LCType As Long, lpLCData As String) As Boolean
'Courtesy of Terry Kreft
Dim lngRet As Long
Dim Locale As Long
  Const LCType_ALLOWED = LOCALE_SDECIMAL Or LOCALE_STHOUSAND _
    Or LOCALE_SMONDECIMALSEP Or LOCALE_SMONTHOUSANDSEP
    If (LCType And LCType_ALLOWED) = LCType Then
        Locale = LOCALE_SYSTEM_DEFAULT
        lngRet = apiSetLocaleInfo(Locale, LCType, lpLCData)
    End If
    LocaleInfoSet = lngRet * -1
End Function
'-----------
Function Locale_Aendern()
If fLocaleInfo(LOCALE_SDECIMAL) = "." Then
    Locale_Aendern = LocaleInfoSet(LOCALE_SDECIMAL, ",")
    Locale_Aendern = LocaleInfoSet(LOCALE_STHOUSAND, ".")
    Locale_Aendern = LocaleInfoSet(LOCALE_SMONDECIMALSEP, ",")
    Locale_Aendern = LocaleInfoSet(LOCALE_SMONTHOUSANDSEP, ".")
Else
    Locale_Aendern = LocaleInfoSet(LOCALE_SDECIMAL, ".")
    Locale_Aendern = LocaleInfoSet(LOCALE_STHOUSAND, ",")
    Locale_Aendern = LocaleInfoSet(LOCALE_SMONDECIMALSEP, ".")
    Locale_Aendern = LocaleInfoSet(LOCALE_SMONTHOUSANDSEP, ",")
End If
' MsgBox "You've changed the decimal separator to " & fLocaleInfo
(LOCALE_SDECIMAL)
Call apiSendMessageLong(HWND_BROADCAST, WM_WININICHANGE, 0, 0)
End Function

 Access-FAQ (tedesco): 
http://www.donkarl.com
[cut]
Grazie :))
sei un mito. :)
Ciao,
--
(^o^))~    Lorenzo   (^o^))~
"Preimaginare e' lo imaginare le cose che saranno..."
"Postimaginare e' imaginare le cose passate ..."
(Leonardo Da Vinci)