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

Database and Form Setup

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

    Database and Form Setup

    Hello again everyone!

    I need help on the proper way to setup a database and I think I can get the form from there but I Will try to explain my dilemma.

    I have a parent table that has the brochure number and a jpg (stored in database) field.

    Each brochure can fit into one or more categories (up to as many as 10 differing categories actually). I have 1-many linked the categories to the parent table via brochure number. On my form I am using a browse to select the different category types. The categories are stored in a category table and thus I am using a table lookup to fill the category field.

    Each category can be subdivided into more detail as related to the category. For example we could have a brochure #12345 that matches multiple categories such as family, individual, business, etc. The detail about the category could also be multiple selections. For example, for the category family it might include details of kids, home, cars, pets. And for the category of business it might include, employees, auto, fitness. And for the category individual it might show details including hobbies, money, and home.

    My question basically is, "Is there a recommended or better way to set this up?" And for presenting and data entry is there a better way than the utilization of browses to enter data?

    Thanks in advance and I hope it is more than "clear as mud".

    #2
    Re: Database and Form Setup

    I think you are speaking of a many to many relationship which Alpha doesn't support directly. If you search this forum on many to many you may get some help.
    There can be only one.

    Comment


      #3
      Re: Database and Form Setup

      thanks Stan. either I am searching wrong or the forum is not working right. When I search for "many to many" I get a no return. Just searching for many I get a no return as well.

      Comment


        #4
        Re: Database and Form Setup

        okay, ingenuity says change search criteria, which I did and found some topics.....will review and hopefully get some ideas.

        Thanks

        Comment


          #5
          Re: Database and Form Setup

          So you have a Brochure that you need to assign to:

          1 or more Categories

          Family
          Business
          Individual

          Now select the details for the Category

          Family -> kids, home, pets
          Business -> employees, fitness

          So, when you're done... do you want to be able to find all the brochures related to Fitness, listed by Category?

          Sounds like you need a Browse for Categories - with dropdown lookups
          and a Browse for CatDetails - with dropdown lookups

          So you can select many Categories and many Details for each Category.

          You'll need a Brochures table, a CatBrochures table and a CatDetails table.

          The relationships would be:

          Brochues to Category Brochures
          Category Brochures to Category Details

          will that do it?

          Comment


            #6
            Re: Database and Form Setup

            David,

            in a nut shell, yeah that closely summarizes it, including my end result wish.

            That said, I do have the dropdown lookup for the categories. And it is via a browse on a data entry form. There is a Simple List Lookup for the this field. I didn't see the need for a table with the same consistent 10 categories.

            The lookup on the second browse is what gives me a problem. I can't seem to get the detail browse and related lookup to work as I think it should. I have tried filtering the lookup but then, if more than one category is present, the filter "seems confused" and only gives me results for the first lookup or all details for all categorires depending on how I set up the lookup.

            As I read your post it seems you are suggesting I put every detail about every category in the same table, is that correct? How would I then filter the details out in the detail field lookup process? In my mind I can see a two field table for details with fields Category and Detail anad the linking field being Category but I don't see how the filter would work when there is more than one category for a brochure.

            Perhaps my old Texas hard head is blind as well.

            Comment


              #7
              Re: Database and Form Setup

              Your form would be based on a set. The set would be the tables:

              Brochures...
              ...BrochureCategories...
              ...CategoryDetails

              In the Brochures table your key linking field would be

              BrochureId
              (record details)

              In the BrochureCategories table you'd have

              BrochureId
              CategoryId
              (record details)

              this will give you lots of Categorys attached to a Brochure

              In the CategoryDetails table you'd have

              BrochureId
              CategoryId
              DetailId
              (record details)

              this will give you lots of details attached to different categories, which are attached to different Brochures.

              I think this would work for what you want. The Browses should filter ok on the form without you having to do anything.

              How about zipping up your database so we can have a look and make sure this would work. I'm still pretty new at A5 but I believe this will work ok.

              Comment


                #8
                Re: Database and Form Setup

                Bob,
                Here is an example I generated that I believe encompasses the original discussions in this thread. As Tom pointed out, it generates the need for M:M relationship which is handled by an interrum linking table. Your original question included "is there a better to add records to a browse rather than through the browse" YES! Use a dialog box. You will see several used or adding to tables for the browses in this example.

                Does this exemplify your wishes and needs?
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                  #9
                  Re: Database and Form Setup

                  I hope I can create that fast in A5 some day... nice Mike... that looks like it to me. I can't figure out a problem with the Category Add button in the browse list at the detail level. It won't add to the b_cat table. There was a missing "enter_end" statement but adding that that doesn't fix it. I can't see what's wrong and there are no errors. The values are there.

                  Comment


                    #10
                    Re: Database and Form Setup

                    David,
                    Thanks. I don't quite get why it isn't working but if category_add() writes to the B_cat table with a table.open() instead of the table.get(), it works. Thanks for the heads up. It was working, since the values in the table were added through this button. Oh well.

                    Code:
                    ' add to table
                    	dim t2 as P
                    	t2=table.open("b_cat")
                    	t2.enter_begin(.t.)
                    	t2.B_id = vbid
                    	t2.C_Id = vcid
                    	t2.enter_end(.t.)
                    	t2.close()
                    Mike W
                    __________________________
                    "I rebel in at least small things to express to the world that I have not completely surrendered"

                    Comment


                      #11
                      Re: Database and Form Setup

                      That's odd... is it my system? Latest V9 build. What are you working under?

                      Changing to .open works fine. The sub_cat code with using .get - wierd. Thanks.
                      Last edited by Davidk; 04-04-2009, 10:42 PM.

                      Comment


                        #12
                        Re: Database and Form Setup

                        David,
                        I too am on a5v9:2095-3264 (new browse) and 2005-3252 (old browse). It aoperates the same with both. It must be something subtle we can't see. OK, thanks and good night for me...
                        Mike W
                        __________________________
                        "I rebel in at least small things to express to the world that I have not completely surrendered"

                        Comment


                          #13
                          Re: Database and Form Setup

                          Mike, that is a GREAT solution. It works fine.

                          One thing I was curious about (given my small amt of A5 knowledge compared to most). What is the logic of the Cat_link and it being set to 1? I am sure it must be what makes it work; I just don't understand why.

                          Also, is there a "bumper sticker explanation" to describe why the use of the category table twice in two different links in the set? The M-M threads I have read didn't seem to outline that.

                          Also, one thing I want to do, and I presume your design will still work, is scan the front page of the brochure into the parent table. Therefore the form would be one brochure at a time versus a browse list with all else present. Shouldn't this work the same way?

                          Thanks again for your effort on this.

                          Comment


                            #14
                            Re: Database and Form Setup

                            Bob,
                            The cat_link is not a "meaningful" link and set to 1 in all records makes all records available to be viewed by all records.

                            The single record as the parent instead of a browse should make no difference, so go for it.

                            Glad it helped out.
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment

                            Working...
                            X