AppConfig.GetRegionCodeFromCountryCodeAndRegionName
Use this method to get a string that contains the region code for the specified country/region code and region name.
Definition
Function GetRegionCodeFromCountryCodeAndRegionName(bstrCountryCode As String,bstrRegionName As String) As String
Parameters
bstrCountryCode
A String that contains the code of the country/region for which the region code is being requested.
bstrRegionName
A String that contains the name of the region within the specified country/region for which the region code is being requested.
Return Values
If this method completes successfully, it returns a String that contains the requested region code. An empty String indicates that the code was not found.
Error Values
This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
This method returns an empty string if the region code was not found.
Country codes, country names, region codes, and region names may be set in Commerce Server Business Desk.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
Example
' oAppCfg is a Commerce.AppConfig object, sResult is a string
sResult = oAppCfg.GetRegionCodeFromCountryCodeAndRegionName("us", "Utah")
See Also
AppConfig.GetCountryCodeFromCountryName
AppConfig.GetRegionNameFromCountryCodeAndRegionCode
AppConfig.GetRegionNamesListFromCountryCode