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

Indexes removed and renamed

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

  • #16
    Re: Indexes removed and renamed

    Stan, here is a function I use that will recreate indexes from a table called zindexes I use that has the definitions in a memo field. It tells the user which ones could not be rebuilt/recreated as the tables were in use.

    'Date Created: 26-Feb-2011 12:57:48 PM
    'Last Updated: 23-Apr-2015 01:09:02 PM
    'Created By : martin cole
    'Updated By : MARTIN
    function indexes_rebuild as L ()
    time1=toseconds(time())
    on error goto errors
    if alltrim(var->masterpassword)=""
    end
    end if
    dim shared is_shadowed as l
    if a5.get_master_path() > ""
    is_shadowed=.t.
    else
    is_shadowed=.f.
    end if
    if is_shadowed=.t.
    mpath=a5.get_master_path() + chr(92)
    end if
    temp=""
    datapath = a5.get_path() + chr(92)
    dim tp as p
    t1=toseconds(time())
    t=table.open("zindexes")
    n=t.records_get()
    m=0
    DIM GLOBAL pDlg1 as waitdialog
    pDlg1.Set_Title("Please Wait")
    pDlg1.Create(1,"Bounce")
    pDlg1.Set_Message("Processing Please Wait")
    pDlg1.Set_Bottom_Message("")
    t.fetch_first()
    while .not. t.fetch_eof()
    lastuse=toseconds(time())
    m=m + 1
    pDlg1.Set_Bottom_Message("Processing " + alltrim(str(m)) + " of " + alltrim(str(n)))
    temp1=alltrim(t.Tablename)
    temp2=alltrim(t.Indexnames)
    if table.in_use(temp1)
    if temp1="zindexes" .or. temp1="menu"
    else
    temp=temp + f_upper(temp1) + crlf()
    end if
    goto next1
    end if
    tp=create_indexes(temp1,temp2)
    ui_yield()
    if tp.haserror
    temp=temp + f_upper(temp1) + crlf()
    end if
    if is_shadowed=.t.
    file.copy(datapath + temp1 + ".cdx", mpath + temp1 + ".cdx")
    file.remove(datapath + temp1 + ".cdx")
    ui_yield()
    end if
    next1:
    t.fetch_next()
    end while
    t.close()
    pdlg1.close()
    t2=toseconds(time())
    t3=t2-t1
    if temp=""
    time2=toseconds(time())
    textindexes.text="Finished - all indexes rebuilt."
    ui_beep(UI_CRITICAL_BEEP); ui_yield(); ui_beep(UI_CRITICAL_BEEP)
    else
    time2=toseconds(time())
    ui_beep(UI_CRITICAL_BEEP); ui_yield();ui_beep(UI_CRITICAL_BEEP)
    msgbox("Note","" + crlf() + "The following tables were in use and could not be updated:" + crlf() + alltrim(temp) + crlf()\
    + "Find out who is using these files, and ask them to go back to the main menu for about a minute while you "\
    + "rebuild the indexes!",48)
    end if
    indexes_rebuild=.t.
    if a5.Get_Master_Path() > ""
    dim temp as c
    temp3="hasteststemp,hashydrogentemps,cscreen"
    for i=1 to w_count(temp3,",")
    temp4=word(temp3,i,",")
    mpath=a5.Get_Master_Path()
    files=filefind.first(mpath + chr(92) + temp4 + ".*")
    WHILE .not. files.eof()
    temp=files.name()
    temp2=file.filename_parse(temp,"ne")
    file.copy(temp,a5.get_path() + chr(92) + temp2)
    files.next()
    END WHILE
    next
    end if
    time2=toseconds(time())
    time3=time2-time1
    msgbox("Note","This took " + alltrim(str(time3)) + " seconds.")
    end
    errors:
    indexes_rebuild=.f.
    err_msg = error_text_get(error_code_get())
    line = error_line_number_get()
    script = error_script_get()
    ui_msg_box("Error", err_msg+" Error occurred at line "+alltrim(str(line,4,0))+ " in script: "+script)
    end
    isopen:
    temp=temp + f_upper(temp1) + crlf()
    1=1
    goto next1
    end
    end function
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


    • #17
      Re: Indexes removed and renamed

      What an emotional roller coaster this has been for me.

      Thanks, Stan, for your update.

      Comment


      • #18
        Re: Indexes removed and renamed

        Stan, you are right.

        Martin, your script answer very well my question about indexes and shadow.

        Craig, I am using this script for the query, instead of using indexes (work-around):

        Code:
        dim frm as P
        frm = topparent.this
        frm:tables:property.filter_expression = "PROP_REF_NO = '" + V_Prop_Ref + "' "
        frm:tables:property.query()
        frm.show()
        frm.activate()
        A possible conclusion:
        Indexes that are removed are very difficult to detected, why they are removed and what expression can not be evaluated.
        (A possible solution would be to inform the user what expression can not be evaluated before Alpha remove an index!! )

        Last point:
        We detected that a index is removed during database compaction.
        Does it mean that we have a record corrupted?
        I used a software (DBF Doctor) to check records and after the fix repair, I got less one record.
        But in Alpha this record seems ok.
        Is there a way do check/repair corrupted dbf files?

        Thanks.

        Comment


        • #19
          Re: Indexes removed and renamed

          1) Does your dbf have a memo field?

          2) After backing up, try duplicating your table, zapping (and packing) the duplicate, and then append in the old table into the new.

          If there are any violations, Alpha used to and still may place the violated records into a new table in the adb directory. The table was named Violated.

          Any errors? Try renaming the new table as the old one, being careful to keep the old one intact. Any better?

          3) Alpha has no tools to repair... And I am skeptical that would solve the issue, since Alpha has pushed the DBF to it's limits in terms of what that foundation can handle.

          4) Looking closely at the one record that was removed by your repair tool, can you glean any idea as to why it is being isolated as corrupt?

          Comment


          • #20
            Re: Indexes removed and renamed

            I use Cal Locklin's AIMS Index rebuilder (http://www.aimsdc.net/Tips_Funcs/AIMS_Index_Rebuild.htm)...
            It has saved me a LOT of grief.

            Indexes can get corrupted for many reasons... particularly irritating is when they simply 'disappear' when Alpha deletes them as a result of a query or when applying an index that fails.
            Another recommendation: keep index names to <10 characters!

            Comment

            Working...
            X