Produce HEX and ASCII in query results or in a visual basic variable

Posted on 2013-09-17
Medium Priority
Last Modified: 2013-09-23
We have a need to produce hex and ascii in the same results field.

The field with data will be bound to a 2D barcode (the square ones you see everywhere now). The format of the data is to look like this:


The <RS>, <GS>, and <EOT> all need to be hex values as follows:

<RS> = Hex 1E, Decimal 30
<GS> = Hex 1D, Decimal 29
<EOT> = Hex 04, Decimal 04

When I run my Access query as follows:

BarCode: "[)>"&Hex(30)&"06"&Hex(29)&"xyz"&Hex(30)&""&Hex(04)& ""

It produces the following:


So, it just converts it to ASCII; however, when I go to scan it, it actually reads that information also. I need the 1E, 1D, and 04 to actually be scanned as HEX for the validation to occur for our client.

Is it possible using an Access query to return these desired results? If not, I will have to look atother piece of software to produce the bar code labels.
Question by:dzirkelb
  • 3
  • 2
  • 2
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39501025
So to be clear, you have this:

..and you want this?:

Author Comment

ID: 39502412
Part of the problem is the explanation.

Where it says <rs>, or <1E>, they are the same thing, description of what is needed for hex.  I don't want to show a hex value in ASCII format, hence the 1E, I want it to actually be a hex value, not a hex value converted to string.

So, it won't actually show the <rs> or the <1E> in a program because hex isn't rendered visible / readable, it is simply translated by the machine seeing it.
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39502556
Then I am not sure that this can be done easily in Access.

I know there are ways to store BLOB ((B)inary (L)arge (O)(B)ject) data in Access, but not sure if this would include pure HEX.

So lets see what other experts may post...
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.


Author Comment

ID: 39502565
I am leaning towards agreeing with you, and ya, a solution is to export it to a text file with binary embedded with the regular string, then link it to a database field, then query that, but meh, no thanks :)
LVL 29

Expert Comment

ID: 39502623
hex isn't rendered visible / readable
Is this similar to a UPS Maxicode barcode?  If so, then I believe you mean that these are non-printable ASCII characters.  
Try this:
BarCode: "[)>" & Chr(30) & "06" & Chr(29) & "xyz" & Chr(30) &"" & Chr(04)
LVL 29

Accepted Solution

IrogSinta earned 2000 total points
ID: 39504740
Any luck with that last suggestion?

Author Closing Comment

ID: 39514833
No luck, we are just purchasing new software that does it easier, thanks for the suggestions.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question