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

Compare Two Databases for structural differences

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

    Compare Two Databases for structural differences

    Hello,

    When developing for an application is use it is helpful to be able to check the structure of your production (in use) database against your development database to make sure the structures exist in the development database before you implement changes.

    The attached utility script does this. I have done limited testing in both verions 5 and 6, and it appears to work.

    Let me know your thoughts,
    Jim

    #2
    RE: Compare Two Databases for structural differenc

    Gee, why didn't I think of that!?

    Jim, this is really great! It will save me a lot of time and make my updates more accurate. It will definitely be added to the "developer utilities" button on my control panel toolbar. Thanks. Where do I send my check?

    I modified the initial dialog box a bit as shown below and in the attachment. Basically, I moved the "both apps must be selected" routine into the dialog itself, along with a warning message, so the user won't have to start over. I also tweaked the appearance, changed the title from "Compare Tables" to "Compare Applications", and added my own personal preference to the OK / Cancel buttons. To simplify the buttons and scripting, I changed them to simply "15OK> and "15Cancel> since that's all that is really needed for simple buttons. I also removed the {region} that's around them, which reduces the size of the area below the line, and added a small space above them so they are centered better vertically. I often don't bother adding that little extra vertical space but in this case I thought it looked noticeably better.

    Also note that I did put a blank space before each of the input boxes and before the OK button. This is strictly to indent them for appearance purposes.

    I also ran it through my Script Formatter before posting it and the options are currently set up to add spaces wherever possible so you will see a few extra spaces in the code. I do this so I can use the 'new' Ctrl-LeftArrow and Ctrl-RightArrow capability for navigating the scripts. The Formatter also added the highlighting around the label and the single quote after the END statement so I can search for END' and not find every END IF, END SELECT, etc. For anyone interested, the Script Formatter is available for free on my website - the only charge is that you are required to tell me you are using it.

    Finally, just another 'plug' for keyboard macros - the bold was added to the subtitles with one keystroke each. By adding this to my keyboard macro program, adding bold to dialogs to make them more readable is now very quick and easy. So far, I haven't confirmed that anyone else in Alpha land is using a keyboard macro but if you are typing a lot of xbasic and not using a keyboard macro you are wasting a LOT of time. I guess that's ok if you want to charge someone for the extra time but, personally, I'd rather make things easier on myself.

    Cal Locklin
    www.aimsdc.net


    To add this code section to the routine, just replace everything from the first DIM statement to the "Create Text List...." header section.

    DIM SHARED vDevelopmentDB as C
    DIM SHARED vProductionDB as C
    DIM SHARED varC_result as C
    '---------------
    TryAgain:
    '---------------
    varC_result = ui_dlg_box( "Compare Applications",
    {ysize=.3}{sp};
    {font=MS Sans Serif,8,b}Select Development Database:{font=MS Sans Serif,8,n};
    [%fTables(*.adb)%.80vDevelopmentDB] ;{sp};
    {font=MS Sans Serif,8,b}Select Production Database:{font=MS Sans Serif,8,n};
    [%fTables(*.adb)%.80vProductionDB];{sp};
    {line=1,0};{sp};

    %dlg%,
    IF a_dlg_button = "OK"
    IF vDevelopmentDB = "" .or. vProductionDB = ""
    ui_msg_box( "DATABASE MISSING", "Please enter both databases or press the Cancel button.", 48 )
    a_dlg_button = ""
    END IF
    END IF
    %code%)
    '********************************************************
    '****** Check to make sure user pressed the 'OK' button and that both DB's have been selected
    IF varC_result "OK"
    END'
    END IF

    Comment


      #3
      RE: Compare Two Databases for structural differenc

      I keep getting the following Alpha Five error:

      Script:Compare Databases line:60
      vArrayDevList[i].table=substr(vArrayDevList[i].path,at(chr(92),vArrayDevList[

      vArrayDevList[]not found

      I attempted to run this script in the Development Database and after getting the error message, created a new database and ran the script from it. Either way I received the same error. Any ideas what may be causing this?

      Ron Wills

      Comment


        #4
        RE: Compare Two Databases for structural differenc

        This sounds silly but are you sure there are tables in your application?

        Comment


          #5
          RE: Compare Two Databases for structural differenc

          I couldn't leave it alone. Here's another update that adds buttons for entering the current database name. Unfortunately, adding the buttons moves the header up away from the input box but I think most people will be able to live with this. I tweaked it a bit but that was the best I could get.

          It exactly replaces my previous script so it also replaces everything from the first DIM statement to the "Create Text List...." header section.

          Cal Locklin
          www.aimsdc.net

          DIM SHARED vDevelopmentDB as C
          DIM SHARED vProductionDB as C
          DIM SHARED varC_result as C
          DIM dlg_result as C
          varC_result = ui_dlg_box( "Compare Applications",
          {ysize=.3}{sp};
          {region}
          {sp};
          {font=MS Sans Serif,8,b}Select Development Database:{font=MS Sans Serif,8,n}{endregion} {region}{endregion};
          [%fTables(*.adb)%.80vDevelopmentDB] ;{sp};{sp};
          {region}
          {sp};
          {font=MS Sans Serif,8,b}Select Production Database:{font=MS Sans Serif,8,n}{endregion} {region}{endregion};
          [%fTables(*.adb)%.80vProductionDB];{sp};
          {line=1,0};{sp};

          %dlg%,
          IF a_dlg_button = "OK"
          IF vDevelopmentDB = "" .or. vProductionDB = ""
          ui_msg_box( "DATABASE MISSING", "Please enter both databases or press the Cancel button.", 48 )
          a_dlg_button = ""
          END IF
          END IF
          IF a_dlg_button = "cur1"
          vDevelopmentDB = a5.Get_Name()
          IF vProductionDB = a5.Get_Name()
          vProductionDB = ""
          END IF
          a_dlg_button = ""
          END IF
          IF a_dlg_button = "cur2"
          vProductionDB = a5.Get_Name()
          IF vDevelopmentDB = a5.Get_Name()
          vDevelopmentDB = ""
          END IF
          a_dlg_button = ""
          END IF
          %code%)
          '********************************************************
          '****** Check to make sure user pressed the 'OK' button and that both DB's have been selected
          IF varC_result "OK"
          END'
          END IF

          Comment


            #6
            RE: Compare Two Databases for structural differenc

            Jim
            It's brilliant especially when updating an old DOS app done in
            A4 to A5
            Thankyou
            Barry

            Comment


              #7
              RE: Compare Two Databases for structural differenc

              Hello Ron,

              ""vArrayDevList[i].table=substr(vArrayDevList[i].path,at(chr(92),vArrayDevList[""

              I had one other version 5 user who reported this same thing. But upon rebooting his computer it has run OK since. I'm pushing my understand of how Alpha deals with arrrays by my dim'ing of a second subelement, after it has been created by the vArrayDevList.initialize_properties() statement. This issue can be coded around fairly simply.

              Want version and build of A5 are you using?

              Thanks,
              Jim

              Comment


                #8
                RE: Compare Two Databases for structural differenc

                Thanks for the kind words Cal.

                ""Where do I send my check? ""
                If you sent one to me, I'd have to send two to you:-)

                I appreciate all you have given to the Alpha community.

                Thanks,
                Jim

                Comment


                  #9
                  RE: Compare Two Databases for structural differenc

                  Thanks Barry,

                  I appreciate it.

                  Jim

                  Comment


                    #10
                    RE: Compare Two Databases for structural differenc

                    By the way, for those who didn't catch the reference, the "Gee, why didn't I think of that!?" was a quote from Jim's newsletter article.

                    Comment


                      #11
                      RE: Compare Two Databases for structural differenc

                      Jim and Cal, I added(replaced) Cal's script in yours, and I am getting that same error message reported by the other user, but rebooting did not help - included is a picture of the dialog I am using:

                      vArrayDevList[i].table=substr(vArrayDevList[i].path,at(chr(92),vArrayDevList[

                      vArrayDevList[]not found
                      Cole Custom Programming - Terrell, Texas
                      972 524 8714
                      [email protected]

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

                      Comment


                        #12
                        RE: Compare Two Databases for structural differenc

                        This is interesting. It's working fine for me in v6 but causes that same error in v5.

                        The only insight I've come up with so far is that the Load_adb_def() command doesn't seem to return a crlf string in version 5. It looks like it in the interactive editor but a check for chr(10) or chr(13) turns up nothing. In v6, it's definitely a crlf sting. The issue with this is that the .initialize() command seems to need a crlf string.

                        I don't have time to dig any further right now but I will when I get a chance.

                        Cal Locklin
                        www.aimsdc.net

                        Comment


                          #13
                          RE: Compare Two Databases for structural differenc


                          It appears that version 5 and the first script have issues. Although the origional script appears to work fine in A5v6, several A5v5 users reported that they have problems running the script. Cal Locklin was very quick to identify what I believe is the source of the problem, the load_adb_def()function. My thanks to Cal for his insight, and to Martin Cole and his fantastic new computer that was especially adept at choking on this script. When I finally got a version to run on Martin's computer, I breathed a sigh of relief.

                          Attached is a modified script that I believe will work well with A5v6.

                          Any feedback on this?

                          Thanks,
                          Jim

                          Comment


                            #14
                            RE: Compare Two Databases for structural differenc

                            Jim:

                            Great utility except I have come accross a problem. I have attached the error message. My development db is on my pc and the actual db is on a lan server. When I run the compare the error message seems to indicate that the pathis not being translated correctly. There should not be a C:\ in front of the path. I have tried mapping the production directory and the result from the program is the same. Thanks for any insight.

                            Steve

                            Comment


                              #15
                              RE: Compare Two Databases for structural differenc

                              Once I mapped the location of one of the databases to a logical drive Letter letter as opposed to a share name it all worked.

                              Comment

                              Working...
                              X