Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Scan of Driver's License 2D Barcode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scan of Driver's License 2D Barcode

    Ever wonder what's in that barcode on the back of your driver's license?

    I just got a new toy that I'm playing around with, and I'd like to incorporate A5 to allow me to use it for something useful. It's a Handheld 2D Barcode Scanner, and I want to use it to scan the barcode on the back of a driver's license, then populate forms with the resulting data. I'm using a special "sample" Maryland driver's license for testing, but it conforms to the AAMVA standards for universal license data coding. (In other words, it should pretty much work the same way on a license from any state using the AAMVA format.)

    So what's in the that funny looking barcode? Well when scanned into a simple wordpad, the result of this particular license looks like this:

    @AAMVA6360030101DL00290197DLDAQD-123-456-789-000DAADOE,JOHN,MICHAEL,JRDAG26 MAIN STDAIVILLAGE PARKDAJMDDAK20912 DARC DAS DAT DAU600DAW167DBA20110124DBB19820124DBC1DBD20051126DBHN

    And here is how the data breaks down, and how they separate the data fields:

    @AAMVA6360030101DL00290197
    DL (Means "Driver's License" as opposed to a non-driver ID card)
    DAQ
    D-123-456-789-000 (Driver's License Number)
    DAA
    DOE (Last Name)
    JOHN (First Name)
    MICHAEL (Middle Name)
    JR (Suffix)
    DAG
    26 MAIN ST (Address)
    DAI
    VILLAGE PARK (City)
    DAJ
    MD (State)
    DAK
    20912 (Zip)
    DAR
    C (License Class)
    DAS
    DAT
    DAU
    600 (Height)
    DAW
    167 (Weight)
    DBA
    20110124 (Expiration Date)
    DBB
    19820124 (DOB)
    DBC
    1 (Sex 1=M, 2=F)
    DBD
    20051126 (Issue Date)
    DBH
    N (Organ Donor Y/N?)

    So now that I know all this, I'm looking for a simple (if possible) way to scan it to a field on a web page, then upon clicking submit, having the data parsed correctly into separate fields for use on that particular web form.

    Has anyone worked with anything like this, or have any ideas on how to set it up? I've played around a little bit with using an "operation" to break apart the fields, but since the delimiters change with every field, it didn't work too well, plus operations are a desktop function, and I'm looking to do this on the web.
    Sergeant Richard Hartnett
    Hyattsville City Police Department
    Maryland

    #2
    Re: Scan of Driver's License 2D Barcode

    I have worked with getting formated text file to something alpha could understand then storing it into fields on a table.

    This functions proved very useful for that for that:
    stringscanner.Create()
    scanner.GetLineText()
    word()
    words()
    w_count()

    Check the out in the documentation, you'll see
    Cheers
    Mauricio

    Comment


      #3
      Re: Scan of Driver's License 2D Barcode

      Rich,

      For this application, it looks like the best approach would be to scan it into a text area, then parse it with extract_string().

      So, for example, if the bar code was read into a variable named BarCodeText, you could have:

      vAddress = extract_string(BarCodeText,"DAG","DAI")

      Then, as Mauricio suggested, for the name, you could use the word() to break that up

      The only issue I see is if the street name is Adai street, or if the person is named Dagwood. To handle that, you could use the occurs() function to check how may times it appears. So if "DAG" appears twice, then you know there could be a problem.

      Pat
      Pat Bremkamp
      MindKicks Consulting

      Comment


        #4
        Re: Scan of Driver's License 2D Barcode

        Hi Rich,

        Parsing a barcode, yours included, is relatively trivial. There are a myriad of character parsing functions that are usable in Alpha, and there is nothing special here.

        The real issue, is that a barcode scanner will scan the data into where ever the cursor is. If the cursor is not where you need data, the barcode characters will be entered wherever it is.

        If you could get the cursor to move to a particular field or dialog box 1st, then the data entered can be used to fill in data or invoke a find, or whatever you needed to be done.

        This is exactly what my CSDA Barcoding Functions for Alpha Five does for the desktop side. (which incidently the trial version has a working function feature that has a test mode that allows you to see all characters that the scanner sends, even special keys) within Alpha Five.

        Doing it for the web side requires handling a javascript key event, which Alpha does not have. It could be done, but each of the 5 most common browsers all handle key events differently (some in major ways, some minor). Unfortunately, there is no current web standard for key events (unfortunately). If one chooses a specific browser, then it is much simpler problem.
        Regards,

        Ira J. Perlow
        Computer Systems Design


        CSDA A5 Products
        New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
        CSDA Barcode Functions

        CSDA Code Utility
        CSDA Screen Capture


        Comment


          #5
          Re: Scan of Driver's License 2D Barcode

          Well thanks to the input from everyone, I'm getting closer.

          I'm trying Pat's suggestion of the "exact_string" expression, and it seems to parse all of the fields correctly, but I'm running into a weird problem that I'm hoping someone might have an answer to .....

          One of the parsed fields is called "DBB_DOB," and it results in a character string date of the person's date of birth. Next to it, I created another field called "DOB," and I'm using the below expression to convert the string to a 'normal' type date:

          DATE_VALUE(VAL(LEFT(DBB_DOB,4)),VAL(SUBSTR(DBB_DOB,5,2)),VAL(SUBSTR(DBB_DOB,7,2)))

          Again, it works correctly, and the DBB_DOB string of 19560115 converts correctly to 01/15/1956, but when I try to start a new record, I immediately get an error message that says: "MONTH IS OUT OF RANGE." Then if I try to close out of the table or delete that record, I get another message that says "ENTER MUST BEGIN FIRST." and then I'm stuck, because it won't go past that point. When that happens, the only way to get out of the table is to forcibly close out of the program.

          The expression to convert the date seems to be working correctly, so I don't know why it keeps saying that the month is out of range, but if I get rid of the expression, the errors go away.
          Sergeant Richard Hartnett
          Hyattsville City Police Department
          Maryland

          Comment


            #6
            Re: Scan of Driver's License 2D Barcode

            I'm trying Pat's suggestion of the "exact_string" expression, and it seems to parse all of the fields correctly, but I'm running into a weird problem that I'm hoping someone might have an answer to .....
            This problem is corrected thanks to Jay Talbott. He recommended using the function STOD() to convert the character string to an actual date, instead of the long expression I was using.

            No more error messages.

            Thanks Jay.
            Sergeant Richard Hartnett
            Hyattsville City Police Department
            Maryland

            Comment


              #7
              Re: Scan of Driver's License 2D Barcode

              Richard

              EDIT: I see you got it working already. Strange that stod() is not throwing an error for you.


              When you start a new record the DBB_DOB field is empty. This results in zeros being passed into the Date_Value function.

              I was going to suggest the STOD() function instead but it to throws an error with an empty string and also with a string of 10 spaces.

              Instead of having two fields I would have only the date type. Convert the barcode text data to a date using stod() as part of your parsing process. That way the actual DOB field does not need to be any type of calculation.
              Last edited by Tim Kiebert; 02-28-2010, 08:38 PM. Reason: too slow
              Tim Kiebert
              Eagle Creek Citrus
              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

              Comment


                #8
                Re: Scan of Driver's License 2D Barcode

                Hi Tim,

                Well I think the problem was related more to the character date field than to the expression. I thought that using STOD() had solved the problem, but as it turns out, it didn't, it just made for a shorter, neater expression.

                This is how I fixed it, although I'm not quite sure what the cause was ...

                My character date field has an expression that parses the date from the long barcode string:

                EXTRACT_STRING(MEMO,"DBB","DB")
                Which results in (for example) 19840117 in a field called "DBB_DOB"

                Whenever I try to convert that field to a date field by either my original expression or the STOD(DBB_DOB) expression, I get the "Month is out of range" error message when I try to exit the table.

                So as a test, I created a second character date field, and used the simple expression (DBB_DOB) to copy the contents of the first character date field into this one, and called it "DBB_DOB2."

                Then I used the STOD(DBB_DOB2) to convert that field's contents to an actual date (01/17/1984), and it works with no errors.

                Now you are suggesting that I go directly from the long barcode string to the actual date field, but I'm not sure how to do that, or how the expression will know where to find the character date, but maybe you can elaborate.

                I do know it's between DBB and DBC in the original barcode text string if that helps.
                Sergeant Richard Hartnett
                Hyattsville City Police Department
                Maryland

                Comment


                  #9
                  Re: Scan of Driver's License 2D Barcode

                  In your first post you said this...
                  Originally posted by Rich Hartnett View Post
                  So now that I know all this, I'm looking for a simple (if possible) way to scan it to a field on a web page, then upon clicking submit, having the data parsed correctly into separate fields for use on that particular web form.
                  Are you still doing that. Can you elaborate a bit on your process. I am guessing you are scanning into a memo field??? Then what is your parsing process. Is it a script of some sort or are you using calculated fields?

                  If I was doing this on the desktop I would have a script that takes the whole set of data and for each field I want to fill find the data and convert it into the data type of that field.
                  Tim Kiebert
                  Eagle Creek Citrus
                  A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                  Comment


                    #10
                    Re: Scan of Driver's License 2D Barcode

                    Tim I haven't got it working on the web yet, right now I'm just trying to get all the parsing correct. And yes, at the moment I am just scanning the long text string into a memo field, and using the "extract_string(BarCodeText,"XXX","XXX")" expression in each of the parsed fields to pull the correct data, and that seems to be working just fine.

                    My original goal was to have a separate web screen (maybe a popup) just for scanning the data into, then when the submit button was pressed, it would parse the data into the correct fields (on the back end), which could then be pulled into any form that had the need for that data.

                    It would be nice to be able to skip the first part of this and have the data go directly into the form that requires it, but since everything I'm doing is web based, I don't see an easy way to accomplish that. Ira has a neat barcode program for desktop applications, but he said it would be somewhat complicated to do in a web browser, since it would vary depending on which browser the client was using.
                    Sergeant Richard Hartnett
                    Hyattsville City Police Department
                    Maryland

                    Comment


                      #11
                      Re: Scan of Driver's License 2D Barcode

                      Tim here's what I'm doing:

                      I have a memo field that takes the following barcode data, and parses it out using calculated fields -

                      AAMVA6360030101DL00290197DLDAQS-542-738-870-099
                      DAASMITH,RICHARD,JOHN,JR
                      DAG26 SAMANTHA CT
                      DAITAKOMA PARK
                      DAJMD
                      DAK20912
                      DARC
                      DAS
                      DAT
                      DAU600
                      DAW167
                      DBA20110124
                      DBB19820124
                      DBC1
                      DBD20051126
                      DBHN

                      Each field is delimited by the first three charcters. The "DBB" string is the person's DOB, which in this case is 01/24/1982.

                      Presently I'm using the following expression to parse out the date string:
                      EXTRACT_STRING(MEMO,"DBB","DB")
                      This gives me "19820124" as a character field, which I call "DBB_DOB."

                      Then I was using a separate (date) field to convert the character string to the actual date:
                      STOD(DBB_DOB) = 01/24/1982

                      This works as I said earlier, but as soon as I try to enter a new record, I get an error message because as you said, the character string for the date field hasn't been created yet, and as such it throws the record into a crazy loop which gives an error message of "MONTH IS OUT OF RANGE," then "ENTER MUST BEGIN FIRST," and stays the way until I force the program to close.

                      Now you suggested that I parse out the character date string and convert it to a regular date all at one time, but I'm not sure what the expression would look like to do that.

                      Could you show me how?

                      Everything else about this application is working correctly except for this date issue, so if I can get this working I'll be finished.

                      Thanks
                      Sergeant Richard Hartnett
                      Hyattsville City Police Department
                      Maryland

                      Comment


                        #12
                        Re: Scan of Driver's License 2D Barcode

                        Originally posted by Rich Hartnett View Post
                        Now you suggested that I parse out the character date string and convert it to a regular date all at one time, but I'm not sure what the expression would look like to do that.
                        Date and Time Functions

                        Stod()

                        The STOD() function converts a character representation of a date into a date value. STOD() generates an error if the input is invalid.
                        There can be only one.

                        Comment


                          #13
                          Re: Scan of Driver's License 2D Barcode

                          Stan thanks for replying so fast, but I'm not really sure what you are telling me?

                          I'm familiar with the STOD() function, and as listed above, I am using it to convert my parsed character string into an actual date. The problem is that it is causing errors at the end of the record, and Tim was suggesting that I parse the character string from the barcode data AND convert it to an actual date all at one time, but I don't understand how to do that.

                          That's what I'm looking for assistance with.

                          I assume it would be some sort of a nested expression, but I've been playing around with it for hours and I can't figure out how to make it work.
                          Sergeant Richard Hartnett
                          Hyattsville City Police Department
                          Maryland

                          Comment


                            #14
                            Re: Scan of Driver's License 2D Barcode

                            Coming into the middle of things but to do both maybe try. If what you did before separately works, then this should too...

                            DBB_DOB = STOD(EXTRACT_STRING(MEMO,"DBB","DB"))
                            Mike
                            __________________________________________
                            It is only when we forget all our learning that we begin to know.
                            It's not what you look at that matters, it's what you see.
                            Henry David Thoreau
                            __________________________________________



                            Comment


                              #15
                              Re: Scan of Driver's License 2D Barcode

                              Thanks for jumping in Mike.

                              I tried that expression you suggested but it does not seem to work. The error is that the expression does not evaluate to a date value.
                              Sergeant Richard Hartnett
                              Hyattsville City Police Department
                              Maryland

                              Comment

                              Working...
                              X