• Ewan Hampson (4/8/2013)


    The way the barcode functions work is always the same: you pass a string with the source code ('bananas') and you get the coded barcode string ( ÑbananasÈÓ, always starts with capital Ñ and ends with Ó).

    I expect one or more of the functions/tools people have suggested will do the business.

    But I wanted to point out that Code 128 is not quite like that. Unlike eg Code 39, it is not a straight character-for-character substitution, so just applying a font with static bracketing values doesn't work. It needs a calculated checksum (which is not shown in the human-readable version nor transmitted to the receiving system, but ensures the quality of the data read by the scanner), which is why you need to apply a function to the data you want to encode. And I do not think the control characters are universal - I have seen different font sets that have made different choices with regard to the extended characters they use to represent the control values. Presumably the ones you specify will work for your environment.

    But, once you've calculated the CheckSum character, it is just as easy as applying the font on a 1:1 basis. Attaining the proper 128-B True Type font isn't all that difficult and neither is calculating the ChecksSum character in T-SQL. I'm working on that for BarCode 128-B right now.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)