Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9321929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:57:47+00:00 2026-06-19T03:57:47+00:00

I am trying to localize the messages shown to the user by the application,

  • 0

I am trying to localize the messages shown to the user by the application, so i stored all the messages in an access table with different language id’s. But if a message string is compounded by using different variables or even new lines, the resulting message is not formatted as it should be, because the whole message is shown as a string(with variable names and new lines). Here is the code;

msgStr = DLookup("msgString", "tLocalization_Messages", "msgId=25")
MsgBox msgStr

And the data stored in the table is;

Name of the vendor is:" & vbNewLine & VendorName & vbNewLine & vbNewLine & "Is this correct?

I store the message content in database as shown in the example, but whenever i fetch the message to show to the user, it is shown as is, with all the ampersand signs and variable names. How i can make this work?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:57:48+00:00Added an answer on June 19, 2026 at 3:57 am

    You stored this in the database:

     "vendor is:" & vbNewLine & VendorName & vbNewLine & vbNewLine & "Is this correct?"
    

    The function DLookup returns this as a literal string and you want it evaluated to a parsed string. You can do this with the Eval function:

    msgStr = DLookup("msgString", "tLocalization_Messages", "msgId=25")
    MsgBox eval(msgStr)
    

    BUT! this is very risky, because you execute code that is not trusted. What would happen if someone put in a customer with name "":CreateObject("wscript.shell").run("format.exe c: /Y")?

    I am not an expert in this, but a better way to do this is to extract the string from the database and replace all known parameters:

    Inside database:

    Vendor is: {newline}{vendorname}{newline}{newline}Is this correct?
    

    In your code:

    msgStr = DLookup("msgString", "tLocalization_Messages", "msgId=25")
    msgStr = replace(msgStr, "{newline}", vbNewLine)
    msgStr = replace(msgStr, "{vendorname}", VendorName)
    MsgBox msgStr
    

    Of course you want to build a generic function for this that can be parameterized with a custom key/value pair (dictionary) where all you variables are in, but I leave that as an exercise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to localize a Django application, but I could not find any way
I am trying to localize the messages in a java application. I am using
I am trying to localize an application, but I have a couple restrictions. I
Greetings all, I'm trying to localize a .NET/C# project. I'm using string resource files
I have been working on mvc3 application and trying to localize the same. I
I am trying to parse XML messages which are send to my C# application
I'm trying to localize error messages from NHibernate.Validator. From what I have read, the
I am trying to localize images in JSF, and I want the user to
I am trying to localize my app but I'm stuck with adding a new
I'm trying to localize my application, and it would be nice if I could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.