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

Trouble Importing Text file

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

    Trouble Importing Text file

    I have been importing a text file into Alpha5 v4.5 for several years without issue, but am getting an unhandled exception error in Alpha5 v10.

    The following is the import routine and the import file is attached.

    '**** Import OSSI comma sep ascii file to OSSI.dbf
    import.type = 0
    import.names = "none"
    import.file = :a5.get_path()+chr(92)+"import.txt"
    import.db = :a5.get_path()+chr(92)+"OSSI.dbf"
    import.skip_lines = 0
    import.skip_bytes = 0
    import.field_sep = "|"
    import.record_sep = "<CR><LF>"
    import.text_qualifier = ""
    import.record_len = 86
    import.rem_blanks = .F.
    import.fields = 10
    import.field1 = "tdate,d,0,8,0"
    import.field2 = "rnum,c,1,8,0"
    import.field3 = "pin,c,3,8,0"
    import.field4 = "lastname,c,4,12,0"
    import.field5 = "firstname,c,5,12,0"
    import.field6 = "balatend,n,6,8,2"
    import.field7 = "section,c,7,12,0"
    import.field8 = "idnum,c,8,4,0"
    import.field9 = "sellprice,n,9,5,2"
    import.field10 = "qtyord,n,10,3,0"
    import()

    Our company uses this routine often, so any suggestions would be greatly appreciated.

    #2
    Re: Trouble Importing Text file

    I just got this error today on a script that has been working for 10 years. Back in build 2515_3506 the import works. Not in builds from 2731_3522. Have not tried others. I have asked Alpha but no formal bug report yet. So you may want to do that.

    Bill.

    Comment


      #3
      Re: Trouble Importing Text file

      Looks like you have found a bug in the "Import" operation. I have been able to reproduce your error. It seems to error on the skipping of the 3rd field in your import.txt file. If I add it so your fields match the number of '|''s then it works fine. You end up with a extra blank field. So a work around would be to import to a temp.dbf table and then use the Append or Copy operation to create your Oasis.dbf.

      Comment


        #4
        Re: Trouble Importing Text file

        I haven't tested ( I will later when I get to an Alpha enabled computer) but....

        The field definitions in the code snippet you posted are not quite correct.
        See the values in red below. Those values are the field offset or number and are zero based. So field 1 and 2 are correct but from there on they are out by one. That it has been working in v4.5 and not now could be due to code being tightened up not to allow that error.
        Code:
        import.fields = 10
        import.field1 = "tdate,d,[B][COLOR=Red]0[/COLOR][/B],8,0"
        import.field2 = "rnum,c,[COLOR=Red][B]1[/B][/COLOR],8,0"
        import.field3 = "pin,c,[B][COLOR=Red]3[/COLOR][/B],8,0"
        import.field4 = "lastname,c,[B][COLOR=Red]4[/COLOR][/B],12,0"
        import.field5 = "firstname,c,[B][COLOR=Red]5[/COLOR][/B],12,0"
        import.field6 = "balatend,n,[B][COLOR=Red]6[/COLOR][/B],8,2"
        import.field7 = "section,c,[B][COLOR=Red]7[/COLOR][/B],12,0"
        import.field8 = "idnum,c,[B][COLOR=Red]8[/COLOR][/B],4,0"
        import.field9 = "sellprice,n,[B][COLOR=Red]9[/COLOR][/B],5,2"
        import.field10 = "qtyord,n,[B][COLOR=Red]10[/COLOR][/B],3,0"
        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


          #5
          Re: Trouble Importing Text file

          I don't think this is a bug. The issue is the extra "|" in the text file which creates field 3. As there is no data there it comes in blank. Try this, worked without an error message.
          Code:
          import.type = 0
          import.names = "ignore"
          import.file = "c:\documents and settings\keith\my documents\import.txt"
          import.db = "c:\documents and settings\keith\my documents\import.dbf"
          import.skip_lines = 0
          import.skip_bytes = 0
          import.field_sep = "|"
          import.record_sep = ""
          import.text_qualifier = "\""
          import.record_len = 0
          import.rem_blanks = .F.
          import.escape_newlines = .F.
          import.import_encoding = "default"
          import.fields = 11
          import.field1 = "field_1,d,0,8,0"
          import.field2 = "field_2,n,1,6,0"
          import.field3 = "field_3,c,2,1,0"
          import.field4 = "field_4,n,3,5,0"
          import.field5 = "field_5,c,4,9,0"
          import.field6 = "field_6,c,5,9,0"
          import.field7 = "field_7,n,6,7,2"
          import.field8 = "field_8,c,7,22,0"
          import.field9 = "field_9,n,8,5,0"
          import.field10 = "field_10,n,9,5,2"
          import.field11 = "field_11,n,10,2,0"
          import()
          Regards
          Keith Hubert
          Alpha Guild Member
          London.
          KHDB Management Systems
          Skype = keith.hubert


          For your day-to-day Needs, you Need an Alpha Database!

          Comment


            #6
            Re: Trouble Importing Text file

            I just heard from Alpha that a fix to this issue should be in the next patch.

            Bill.

            Comment


              #7
              Re: Trouble Importing Text file

              Sorry Keith,
              I'm going to disagree with that. The way it is written is to pass the extra '|' in the import file.
              If you use Alpha's Import Genie, the Genie gives you the option to not import a delimited field. See first thumbnail. The resulting Xbasic code in my example is written the same as Oasis's code. When setting any field to "not" post causes the error. See 2nd thumbnail. I played with this issue for an hour last night and I think we are correct. It's a bug.

              ***Looks like I'm too slow in posting and that Bill got an answer from Alpha.

              Comment


                #8
                Re: Trouble Importing Text file

                Hi Dale,

                Thanks for the thumbnails, I missed that option not to import the selected field.

                Sure looks like a bug to me now.
                Regards
                Keith Hubert
                Alpha Guild Member
                London.
                KHDB Management Systems
                Skype = keith.hubert


                For your day-to-day Needs, you Need an Alpha Database!

                Comment


                  #9
                  Re: Trouble Importing Text file

                  Thanks for the quick and thorough responses. Look forward to the patch.

                  Comment

                  Working...
                  X