Alpha Video Training
Results 1 to 15 of 15

Thread: Restructuring a Table

  1. #1
    Frank Cashman
    Guest

    Default Restructuring a Table

    I'm a new user and have imported a FoxPro 2.6 database as my first table in a new Alpha Database. I wish to restructure the table to a great extent and I have a problem with the Table Editor as it doesn't seem to have an insert function or move whole line function amongs other things. In fact when a whole line is selected by clicking in the right hand column the Cut Copy Paste etc, Menu is "greyed out" and the right click menu is not available whereas if one field only is selected both are available. I can get around this by using FoxPro to restructure the database to some extent using Modify Structure which is very flexible, then import to Alpha and carry-out other modifications allowed by the Table Editor.
    I'm bringing in a large amount of data with the structure.
    Have I overlooked anything in my ignorance of Alpha (which impress me greatly in other respects). Thanks......

  2. #2
    Frank Cashman
    Guest

    Default RE: Restructuring a Table

    A note from Frank - oops! make the right column the left column.

  3. #3
    Member
    Real Name
    Colin Roberts
    Join Date
    Feb 2003
    Posts
    287

    Default RE: Restructuring a Table

    Frank
    You cannot insert fields, you add them on the next blak line and then move them up.

    To move - Select the line, release the mouse button, re-apply the mouse pressure and drag up or down to desired position.

    Colin

  4. #4
    Member
    Real Name
    Allen Yelverton
    Join Date
    Nov 2003
    Posts
    51

    Default RE: Restructuring a Table

    Actually you can insert a field using the insert key.

    To delete a field, move the cursor to the left of field name (normally the row selector area) and click when it turns to a black arrow to highlight the row. The delete key will delete the row.

    I have seen threads where moving fields, adding new fields in the middle, etc. has caused problems. Most of the Alpha gurus on the board will tell you to add the new fields to the end of the table. I had already restructured several tables before I saw these warnings and have not had a problem. If you really need to insert and move fields, compact the database frequently (after every couple of changes). Just through pure blind luck, I was compacting regularly when I was doing my restructuring.

    Instead of restructuring the table containing the data, consider duplicating the table, empty the duplicate, restructure the duplicate and use an append operation to map the fields from the original to the restructured duplicate. Still compact frequently while restructuring.

  5. #5
    Frank Cashman
    Guest

    Default RE: Restructuring a Table

    Thank's for your help Colin.

  6. #6
    Frank Cashman
    Guest

    Default RE: Restructuring a Table

    Thank's for your help Allen...

  7. #7
    Member
    Real Name
    Colin Roberts
    Join Date
    Feb 2003
    Posts
    287

    Default RE: Restructuring a Table

    Frank
    You said

    ...when a whole line is selected by clicking in the right hand column the Cut Copy Paste etc, Menu is "greyed out"...

    For what it's worth
    the normal Cut Copy Paste keystokes are still usable.

  8. #8
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default RE: Restructuring a Table

    Frank,

    Allen's comments are correct - there is a natural tendancy to want to insert a new field where it 'logically' belongs. However, there is no operational reason to do this. Just add the new foelds(s) at the bottom of the table, and in design mode, on your form place the field where you want it. Then click on 'Arrange', 'Set Tab Order' and set the tab (prompt) order that you want. Thay way, the cursor enters the field in the sequence you want, without regard to the order they appear in the underlying table or set.

    Dave

  9. #9
    Frank Cashman
    Guest

    Default RE: Restructuring a Table

    Thank's for the info Dave. Alpha is a somewhat different world from FoxPro for and Fox for Windows. I suspect I might have to ask for help a few times.

  10. #10
    Frank Cashman
    Guest

    Default RE: Restructuring a Table

    Thank's again Colin. I've managed to fix up the structure OK using all the advice.

  11. #11
    Frank Cashman
    Guest

    Default RE: Restructuring a Table

    Thank's for your advice Dave. I seem to be OK now with this subject. Nice to get get so many helpful replies.

    Frank

  12. #12
    Joe McGovern
    Guest

    Default RE: Restructuring a Table

    Hi Dave.

    I'm trying to add a field or two to a database and can't follow your answer about "add new fields at the bottom of the table". Dumb question, but where is the bottom? I see the New Record row at the bottom, but that will not take a new field entry. I must be missiing something obvious. If I ever get a new field entered in the table, how will it make its way into the form?

    Joe

    Dave Jampole wrote:
    -------------------------------
    Frank,

    Allen's comments are correct - there is a natural tendancy to want to insert a new field where it 'logically' belongs. However, there is no operational reason to do this. Just add the new foelds(s) at the bottom of the table, and in design mode, on your form place the field where you want it. Then click on 'Arrange', 'Set Tab Order' and set the tab (prompt) order that you want. Thay way, the cursor enters the field in the sequence you want, without regard to the order they appear in the underlying table or set.

    Dave

  13. #13
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Restructuring a Table

    " I see the New Record row at the bottom, but that will not take a new field entry. I must be missiing something obvious." - Control panel, hilight table, right click, choose restructure table.

    You cannot add fields while viewing a browse.

  14. #14
    Joe McGovern
    Guest

    Default RE: Restructuring a Table

    Hi Stan.

    Thanks - that's the answer. The manual is marginally helpful. Thanks for the quickest response I've ever seen!

    Joe

    Stan Mathews wrote:
    -------------------------------
    " I see the New Record row at the bottom, but that will not take a new field entry. I must be missiing something obvious." - Control panel, hilight table, right click, choose restructure table.

    You cannot add fields while viewing a browse.

  15. #15
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default RE: Restructuring a Table

    Frank - and anyone else who reads this. I think I probably said much of this on another thread somewhere on this message board but I'll repeat it anyway....

    The table can be restructured by inserting fields and deleting fields and moving fields and changing field types and changing field sizes. I've done this in many cases with no problems. However, I've also done it and caused problems. My current philosophy has worked without problems for years:

    1. Do one operation type at a time then save the changes before going to the next operation type. (Examples: insert fields then save; move fields then save; modify names then save; modify sizes then save; etc.)

    2. When moving fields, move a few then save. If you are moving enough to get yourself confused, Alpha may get confused too.

    3. As in #2, if you are doing anything and start to get confused about what has been changed, save your work - Alpha may be getting confused to. And, it may not be Alpha that's getting confused; it may be you. Or, maybe Alpha can only keep track of moving so many fields before it says "Tilt!"

    So far I've never seen any benefit from compacting the database but I suppose that's possible. Or, it may just be that you had to save the table changes before you could compact.

    The only time I'm careful about adding fields to the end of a table is after the app is in production. It's relatively easy to build a routine in the autoexec script to add a new field to a table with xbasic but this routine will only add the field(s) at the end of the table. So, in order for everything to work on a remote customer's site without me actually travelling there to make the changes, or getting remote access and making them get a full version of A5, or copying all their data and changing it myself before sending it back to them (all of which are way too much work), I just add the fields at the end of my copy of the table (which probably has out of date data but it doesn't matter) and create a routine to add the fields the first time the autoexec runs after the update. Even if one of the users hasn't logged out and updated, their system will still work because the original fields are still in the same place they always were.

    Cal Locklin
    www.aimsdc.net

Similar Threads

  1. restructuring error with numeric field
    By Cheryl Lemire in forum Alpha Five Version 6
    Replies: 4
    Last Post: 09-15-2004, 12:46 PM
  2. Restructuring table with xbasic
    By Greg Fong in forum Alpha Five Version 4
    Replies: 3
    Last Post: 05-16-2002, 04:18 PM
  3. Restructuring a large database
    By Colin Younger in forum Alpha Five Version 1
    Replies: 2
    Last Post: 06-13-2001, 10:27 AM
  4. Restructuring alpha filing sys
    By Wanda Friesen in forum Alpha Five Version 4
    Replies: 9
    Last Post: 02-09-2001, 01:31 PM
  5. Restructuring Table
    By Michael Hernandez in forum Alpha Five Versions 2 and 3
    Replies: 0
    Last Post: 12-12-2000, 06:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •