Microsoft KB Archive/210455

= ACC2000: Sample Function to Determine Language Version =

Article ID: 210455

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q210455



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SUMMARY
Microsoft Access ships in and can use several languages. This article shows you how to create a sample function that you can use to determine which language version of Access is installed, which language version the user interface is using, and which language version the Help file is using.



MORE INFORMATION
Access keeps track of language specific information by associating the files with a Local ID (LCID). This function uses the LanugageID property to return the LCID for different parts of Access. The LCID is passed to the LangID function to resolve the LCID into a friendly name for the language. Not all supported languages are handled in this function, but you can add aditional Case statements to handle additional languages.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.   Create a new module and type the following in the Declarations section: Option Compare Database

Public Declare Function GetLocaleInfo Lib "kernel32" Alias _ "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, _  ByVal lpLCData As String, ByVal cchData As Long) As Long

Public Const LOCALE_SLANGUAGE = &H2  On the Tools menu, click References. Make sure there is a reference to Microsoft Office 9.0 Object Library.  Type the following procedures: Function StLangOfLcid(lcid As Long) As String

Dim st As String Dim cch As Long st = String(256, vbNullChar) cch = GetLocaleInfo(lcid, LOCALE_SLANGUAGE, st, Len(st)) StLangOfLcid = Left(st, cch - 1) End Function Sub FindLanguage

Debug.Print "The language that is installed is: " & _ StLangOfLcid(LanguageSettings.LanguageID(msoLanguageIDInstall)) Debug.Print "The language of the user interface is: " & _ StLangOfLcid(LanguageSettings.LanguageID(msoLanguageIDUI)) Debug.Print "The language of the help files is: " & _ StLangOfLcid(LanguageSettings.LanguageID(msoLanguageIDHelp))

End Sub   Type the following line in the Immediate window, and then press ENTER: FindLanguage 

