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

Import and Append Error Msg

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

    Import and Append Error Msg

    I am consistently getting an error message represented by the image below called Image1-ErrorMsg

    I have tried a variety of approaches to get data from table A in a master database into a smaller database that is a mirror of the larger (just smaller).

    Every time I run an Append data or Import I get the message.

    The image ExportTable is the structure from the larger table. The image ImportTable is the structure of the smaller table.

    The numeric fields in the receiving table are not too large as numeric fields.

    The unusual part of the operation is that when I click the OK button on the error message and then review the table all the data is in the table as it should be. I can find no number in any numeric field larger than 3 digits (plus 2 decimals. In any table in the entire set there is no field with a number larger than 4 digits.

    Any suggestions as to where I should look or what the problem might be?

    The code for the import is as follows and is generated from the import genie versus me doing the hard code.

    temporary_import_table = file.temp_path_get()+ "driver_temp_table.dbf"
    import_destination_table = "driver"

    import_filename = filename_decode("[exe_folder]files\districts\central\27\districtexportdriver.txt")
    if file.exists(import_filename) = .f. then
    ui_msg_box("Error","File to import not found: '"+import_filename+"'.",ui_stop_symbol)
    end
    end if

    ON ERROR GOTO ERROR2202200718596562


    import.type = 0
    import.names = "use"
    import.file = import_filename
    import.db = temporary_import_table
    import.skip_lines = 0
    import.skip_bytes = 0
    import.field_sep = ","
    import.record_sep = "<CR><LF>"
    import.text_qualifier = "\""
    import.record_len = 87
    import.rem_blanks = .F.
    import.escape_newlines = .F.
    import.fields = 8
    import.field1 = "hhnbr,c,0,16,0"
    import.field2 = "policynbr,c,1,16,0"
    import.field3 = "last_name,c,2,30,0"
    import.field4 = "first_name,c,3,25,0"
    import.field5 = "gender,c,4,7,0"
    import.field6 = "birthday,d,5,8,0"
    import.field7 = "pref150rate,n,6,9,2"
    import.field8 = "age,n,7,2,0"
    import()


    a_tbl = table.open(import_destination_table)
    append.t_db = temporary_import_table
    append.m_key = ""
    append.t_key = ""
    append.m_filter = ""
    append.t_filter = ""
    append.type = "All"
    append.m_count = 8
    append.m_field1 = "HHNBR"
    append.m_exp1 = "@driver_temp_table->HHNBR"
    append.m_field2 = "POLICYNBR"
    append.m_exp2 = "@driver_temp_table->POLICYNBR"
    append.m_field3 = "LAST_NAME"
    append.m_exp3 = "@driver_temp_table->LAST_NAME"
    append.m_field4 = "FIRST_NAME"
    append.m_exp4 = "@driver_temp_table->FIRST_NAME"
    append.m_field5 = "GENDER"
    append.m_exp5 = "@driver_temp_table->GENDER"
    append.m_field6 = "BIRTHDAY"
    append.m_exp6 = "@driver_temp_table->BIRTHDAY"
    append.m_field7 = "PREF150RATE"
    append.m_exp7 = "@driver_temp_table->PREF150RATE"
    append.m_field8 = "AGE"
    append.m_exp8 = "@driver_temp_table->AGE"
    append.t_count = 0
    a_tbl.append()


    GOTO CONTINUE2202200718596562
    ERROR2202200718596562:
    ON ERROR GOTO 0
    ui_msg_box("Error","Error running Import Operation"+crlf()+error_text_get())
    END
    CONTINUE2202200718596562:

    a_tbl.close()

    'In case the destination table is not already in the Database, add it...
    file_add_to_db(table.filename_get(import_destination_table))
    'If the Operation is run from within a Form or Browse, then refresh the window
    if is_object(topparent.this) then
    if topparent.Class() = "form" .or. topparent.class() = "browse" then
    topparent.Refresh_layout()
    end if
    end if

    #2
    Re: Import and Append Error Msg

    Are either of the numeric fields in the destination table defined as calculated fields?

    The unusual part of the operation is that when I click the OK button on the error message and then review the table all the data is in the table as it should be.
    Because the append halted at the point the error occurred. Check the next record that would be appended from the transaction table to find the problem values.
    There can be only one.

    Comment


      #3
      Re: Import and Append Error Msg

      Thanks Stan!

      That fixed the error probloem plus send me back to brainstorm as to resolving the two fields that are calculated. I believe I know what to do (which is a good thing I guess).

      I would never have known that one, that's for sure.

      Comment


        #4
        Re: Import and Append Error Msg

        Originally posted by Mortie View Post
        Thanks Stan!

        That fixed the error probloem plus send me back to brainstorm as to resolving the two fields that are calculated. I believe I know what to do (which is a good thing I guess).
        Bob,

        You are not alone. Just FYI, I recently had a situation where a client told me he wanted field, say n_months to = n_yrs * 12, where n_yrs would never be more than 30 years and comes in via an import (actually an append, but it does not matter). So I created a calculated field via field rules 3 digits long (n_months) and a 3 digit field n_yrs where n_yrs would get its value via an import/append operation. Note that 2 digits for n_yrs should have been sufficient and would have given a better clue to the problem that was coming. In any case, all went along smoothly for a long time--until one day someone inputting data into the import file put in 360 instead of 30 years (room for it, lack of training and no validation). Although I had room (somewhat unfortunately!) for 360 to be imported into my n_yrs field, obviously 360*12 = 4320 and that won't fit into the calculated 3 digit n_months field. The error message, like yours, was not as helpful as it perhaps should be, but it was not totally incorrect either. Live and learn!

        Ray Lyons

        Comment

        Working...
        X