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

Modular Database Design Question

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

    Modular Database Design Question

    I know that a group of related scripts and functions can be put into accessory database files or into .aex files to be loaded by a main database, but I was wondering whether the same can be done with groups of tables and sets. That is, if you have some large, unwieldy application with multiple sub-modules, can the tables and sets (with their accompanying layout designs) for a module be loaded when the module's database is attached to the primary database? Right now it seems to me that the tables and sets have to be added to the primary database, otherwise they will not appear.
    Any one of you have any insight on this? It seems to me that this would be a great advantage for those of us who suffer from application waistline expansion.

    #2
    RE: Modular Database Design Question

    Peter,

    Of course you know we can add and drop tables/sets from the database file (adb) under program control, and we can also look at the tables/sets associated with other adb files, so yes, I believe you could dynamically combine and separate individual applications.

    There might be some path implications in code and a few expressions that would need to be made path independent.

    The adb files would basically be the list of supporting tables/sets for each submodule.

    Regards,

    Ira
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture


    Comment


      #3
      RE: Modular Database Design Question

      Peter:

      Would it be absolutely necessary to add the sub-module components to the main database?

      Assuming that each module's components are stored in a known sub-folder of the main, it should be possible to address them all directly without ever adding them to the primary database.

      mainpath=:A5.Get_Path()+Chr(92)
      mod_path1=main_path+Chr(92)+"MOD_Path_a"+Chr(92)
      f=form.view("billing@"+modpath_1+"bill.set")

      will open the billing form. I don't know how widely you could apply this, but is should work.

      I remember reading a couple of messages from Tom Henkel outlining how hw dealt with some of these types if issues within their multi-module app.

      Finian
      Finian

      Comment


        #4
        RE: Modular Database Design Question

        The new A5.load() method may be relevant since it closes the current database and loads another. I haven't done much with it but in principle it should make it as simple to jump around among databases as it is among sets or tables.

        Bill
        Bill Hanigsberg

        Comment


          #5
          RE: Modular Database Design Question

          Ira,
          I've never had to use the add and drop tables/sets from the database file (adb) commands.
          Does that actually write to the adb file?? If so if you are running optimized is it happening to the shadowed adb? If you are not running optimized does it write to the adb on the server and change it for all??
          I'd not be too comfortable doing that regularly with lots of tables on an app with a lot of users.
          John

          Comment


            #6
            RE: Modular Database Design Question

            What I was looking for is a "one-click" method to add a whole adb file and its associated tables and sets to a database, much the way that an addin can be added by putting an .aex file in the \addins folder. I don't think there is any one-click method and clearly some extra programming is required, particularly in network optimized settings.
            One solution would be to provide a cr-lf delimited text file of tables and sets in the upgrade, along with the version number of the upgrade. The autoexec for the application would check for the file -- it could be as simple as "upgrade.txt" -- and if found, it could then add the tables and sets as Ira suggests, attach the library to the database (there must be a method somewhere to do this), set the application version to the new version, and then delete the upgrade.txt file.

            now -- does anyone know the xbasic method for adding a library to a database?

            Comment


              #7
              RE: Modular Database Design Question

              John,

              Those are good questions.

              As I recall, it definitely modifies the adb of the master when not shadowed.

              When shadowed, I believe it would change the shadowed adb file, but I'm not really sure. This would definitely be a minor operational change that could change between releases unless established as a method that developers are using and maintained by Alpha Software as such.

              If anything, it should change the shadowed version, but I can see reasons why it may not, as a shadowed table is really just a pointer.

              You bring up some real valid points. On the other hand, there are many methods that allow direct manipulation of a table, whether or not it's in the ADB.

              But that does not address Peter's problem. If you consider a "dummy" adb file that get's loaded one time by all of the installed "modules", then you are doing it as an install, rather than a live modification, and I would consider this an acceptable method in that case

              Regards,

              Ira
              Regards,

              Ira J. Perlow
              Computer Systems Design


              CSDA A5 Products
              New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
              CSDA Barcode Functions

              CSDA Code Utility
              CSDA Screen Capture


              Comment


                #8
                RE: Modular Database Design Question

                Peter,

                Peter Wayne wrote:
                -------------------------------
                now -- does anyone know the xbasic method for adding a library to a database?



                Create an AEX file that is the same name as the adb file. If you want, there is an Xbasic method to combine multiple AEX libraries into one, the method name escapes me for the moment.

                Regards,

                Ira
                Regards,

                Ira J. Perlow
                Computer Systems Design


                CSDA A5 Products
                New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                CSDA Barcode Functions

                CSDA Code Utility
                CSDA Screen Capture


                Comment


                  #9
                  RE: Modular Database Design Question

                  Ira,
                  I agree that in an install it would be acceptable.
                  I thought Peter was looking for a way to break a very large app into modules and have the ability to add all the module tables and sets with a simple command.
                  John

                  Peter,
                  Your install method sounds okay. I would think it would be easier to have an already attached dbf file that is overwritten. It's records would show tables not yet added.After adding the tables the records could be deleted.
                  John

                  Comment


                    #10
                    RE: Modular Database Design Question

                    You could use string = load_adb_def( DatabaseName, Mode ) to get a list of all the tables and sets then use File.copy() and file_add_to_db() to add them in.

                    Here's some test output from running load_adb_def() in my interactive window:
                    ?load_adb_def("H:\A5v5\_A5v5_std\Std_code.adb")
                    = h:\a5v5\_a5v5_std\capitals.dbf
                    h:\a5v5\_a5v5_std\std_code.dbf
                    h:\a5v5\_a5v5_std\app_codes.dbf
                    h:\a5v5\_a5v5_std\test.dbf
                    h:\a5v5\_a5v5_std\zipcode.dbf
                    h:\a5v5\_a5v5_std\states.dbf

                    I couldn't find a "one step" method for copying a table but there is an A5_duplicate_set_files() function that might work - but read the description first because it appears to have some limitations. However, although I'm guessing it's got to be there, I couldn't find anything for copying a table that handled it in the background without popping up a dialog box. However, I'm sure you can figure out a way to copy the files once you have the name and path for the table/set.

                    The question with the al* files would be what do you want to copy? I'm not sure you could attach the library but I wouldn't be surprised to find there's a way - this would certainly be easiest. However, attaching the library probably won't bring over any saved settings, etc. that may be stored in the .al* files. Separate code might have to be created to get at them. (I know the later can be done because I created my own AIMS_Drop_setting_old() function when the A5.Drop_settings() wouldn't work. It's called "old" because my new version lists all available settings in a dialog box and lets you pick which one to drop - I got tired of forgetting what settings I had created.)

                    I can't find a one-step method for copying over all the scripts if you wanted to do that but the EXPORT_SCRIPTS_AND_UDF() and IMPORT_SCRIPT_UDF() functions could at least make it much easier. You might have to run the export manually but you could probably do the import as part of the overall "import database" function.

                    I can't help wondering if it would really be worth all the effort. (This from a nut-case that created an improved Xbasic script formatter with optional indent/spacing/capitalization settings just to see if he could do it!)

                    Comment

                    Working...
                    X