Code 39 Barcode font translates incorrectly

I'm working with SQL Server and Crystal Reports Version 8.5.   I am printing several fields as readable fonts and the same values in code 30 font.   Four of the five fields scan as I expected.  The formula I am using is "*"+{table_name.field_name)+"*".   The field I am having problems with is data coming out of a memo field.   I accessing the data via a view I created.  I converted the memo to varchar.    The data in the memo field is:  No:MTR-12345 Qty:2.   When I scan the bar code I get:  N**MTR-12345Q***2.   I have the scanner set to code 39 full ASCII.  Any help is appreciated.
Tim RaganAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The standard Code 39 repertoire defines 44 characters: 26 upper-case alphabetics, 10 digits, space character, stop/start character, 6 punctuation symbols.

The extended Code 39 repertoire adds lower-case alphabetic characters, additional punctuation symbols, and control-code characters.

But these additional characters have to be encoded as two characters; for example:

o: should be encoded as +O/Z
ty: should be encoded as +T+Y/Z

See for a description & longer explanation.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tim RaganAuthor Commented:
I'm unsure as to how I will solve this problem even though I understand it now.   Thanks.
>> ... I'm unsure as to how I will solve this problem ...

You just need a more complex formula, where you check each character in your input data against a table of (128) values which maps each input character to the required output characters, or characters.
As the Code 39 extended repertoire is exactly the same as the basic ASCII coded-character set, just use the character-code (returned by functions such as Chr$()), associated with each input character, as an index into the table; input characters with character codes of 128 - 255 would obviously be errors.

E.g. "a" has ASCII character code 97, so the 98th entry in the table (indexed from zero) would indicate that the required output characters are "+A".  

I don't use either SQL Server or Crystal Reports, so can't offer any more specific advice.

.., and it seems that the start/stop characters must be encoded as "/J" instead of "*" to indicate use of the extended Code 39 variant.
So the 43rd entry in your table (for input character code 42) would map to "/J".
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Tim RaganAuthor Commented:
There data in the field will be of various lengths and character types.  The first three characters of any record will always be No:   Anything can happen after that.  If I understand your reference to 43 entry be the character count in the field.
>> ...  reference to 43 entry be the character count in the field ...

No; 43rd entry in (constant) table in your mapping function.

I was perhaps over-simplifying things when I said "You just need a more complex formula".

What you actually need is some sort of function.
As I stated before, I have no knowledge of either SQL Server or Crystal Reports, but I assume that one or the other may provide some sort of scripting language, with which you could write a suitable mapping function.
Tim RaganAuthor Commented:
Thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.