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

Looking for quick& easy method to make table Read Only

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

    Looking for quick& easy method to make table Read Only

    I have two tables, Active.dbf and Inactive.dbf and want to simply make Inactive.dbf a read only table where users can not change but are able to view it. I am looking for hopefully a one line command. The two tables have the same structure. Are there any adverse affects.
    Thanks kindly to all.
    Peter

    #2
    Peter,

    I could be wrong, but I do not believe there is a way to make a 'table' read-only. It sounds like you want to move certain records to an inactive table and allow the viewing of those records only. The only way I know to control this is to make the 'forms/browses/reports/layouts' that the users have access to as read-only. That can easily be accomplished in the layout properties by restricting the access.

    Not real sure why you would need two tables, active/inactive?
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #3
      That should be done on the front -end

      Is the viewing of the records done on a form, browse, or xdialog??
      If it is done of a form or browse, you should just be able to go to the properties of each field on the form or browse and check the "Read-Only" property. Also you can do it on the form or browse properties by restricting changes.

      hope this helps
      The Mexican

      Comment


        #4
        Thanks Cheryl, Mario,
        I am aware of placing restrictions on the front end but I was looking for simple option to make the table a view only. I need to maintain two databases for purposes of a paper trail.
        Peter

        Comment


          #5
          Originally posted by pk9
          Thanks Cheryl, Mario,
          I am aware of placing restrictions on the front end but I was looking for simple option to make the table a view only. I need to maintain two databases for purposes of a paper trail.
          Peter
          How about a simple statement for the cansaverecord field rule event?

          cancel()
          There can be only one.

          Comment


            #6
            Peter,

            I don't think there's a single one-step answer. You might consider using field rules for the table to set the "skip" property "true" for each field. Then, no matter which form or browse is used to display records, the user won't be able to edit any of the records. This isn't complicated, but it can be tedious.

            -- tom

            Comment


              #7
              Thanks, Stan/Tom
              I was trying to avoid field by field restrictions. What would happen if the dbf file was made read only by the OS?
              Peter

              Comment


                #8
                Peter,

                I need to maintain two databases for purposes of a paper trail.
                How are you creating the second db and keeping it updated? You mention a paper trail? If the two db's are exactly the same, then wouldn't just one suffice as your paper trail?

                It almost sounds to me more like you need an audit trail, not a second db? Can you explain in more detail exactly what you are trying to accomplish?
                Cheryl
                #1 Designs By Pagecrazy
                http://pagecrazy.com/

                Comment


                  #9
                  Originally posted by pk9
                  Thanks, Stan/Tom
                  I was trying to avoid field by field restrictions. What would happen if the dbf file was made read only by the OS?
                  Peter
                  How about a simple statement for the cansaverecord field rule event?

                  cancel()

                  This is not a field by field solution. This is a record level event not tied to any field.
                  There can be only one.

                  Comment


                    #10
                    Peter, the file.attributes_set() method seems able to set the "read only" attribute for a file. why not try it with a table and let us know ?

                    -- tom

                    Comment


                      #11
                      Cheryl,
                      The structure is the same not the data. As the dbf names indicate some data from the Active will be moved over to the Inactive and the Inactive dbf rarely used. There is a 3rd and 4th dbf called Archived and Issued respectively that have the same functionallity as Inactive. As you can imagine over time (multi years) the Inactive and Archived etc will be very large db that do not need to be used with the Active.dbf
                      Hope that helps explain dbf design.
                      Peter

                      PS Tom I will try your function and post results.
                      Thanks

                      Comment


                        #12
                        Peter,

                        I am contemplating the same type of structure so that the working table remains small and fast while the inactive and archive slowly grow as data is moved from the active in a timely process.

                        Thinking on it, if you make the db (table) read only, you won't be able to migrate data from active to inactive. In reading thru these posts, I think it would be better if you were to create a form to view the data in inactive that doesn't allow enter or change modes.
                        My two cents worth :)

                        Oran

                        Comment


                          #13
                          Stan has twice posted a solution that works and is better than changing the file properties in Windows. Any user can change the file properties from read-only to read-write from the OS level, if they know how to use the "attrib" command from a command prompt.
                          Rather than code for the CanSaveRecord event, though, I have usually coded for the CanChangeRecord event. A simple script in the field rules for CanChangeRecord:
                          Code:
                          cancel()
                          ui_msg_box("Read-only data","You are not authorized to make changes here!")
                          It's the only place you have to put the code and applies to all forms and browses you create; it doesn't have to be repeated anywhere. You should be aware that you can still write Xbasic scripts that will move records to the archive table, as Xbasic scripts will override the field rules. I don't know for sure (since I haven't tried it) but I would think that operations will also override the field rules, since operations get translated into Xbasic commands.

                          If you put the read-only restriction in the field rules, you have the option of overriding it for, say, a user classified as an "administrator". However, if you're looking for a codeless way to make the table read-only for users, why not use the security features built in to A5? You can set the user permissions for the table to "deny" for changes, deletions, additions, for the group "sales", yet all persons in the group "administrator" to change the records.
                          Last edited by Peter.Wayne; 06-27-2006, 07:27 AM.

                          Comment


                            #14
                            What about protecting the tables from the admin?

                            I've been wondering how legally sensitive information, such as medical records, can be protected from editing once they've been created. The posts here seem to be saying that access and edits can be prevented only on the form/browse level. Meaning there is no way to prevent someone with admin rights from altering existing data in tables?
                            Jim

                            Comment


                              #15
                              Jim,
                              No, you don't have to change each form or browse. One simple way is to have a logical field called, say, "signed", and have the code for the CanChangeRecord event:
                              Code:
                              if signed=.t. then
                                cancel()
                                ui_msg_box("Signed Note","Changes not allowed!")
                              end if
                              If corrections have to be made, you can have another form or Xdialog that will add an addendum to the pre-existing note, clearly marked as an addendum, with the date and time and the name of the user making the addendum.

                              The beauty of this scheme is that once the user has indicated "signed" is .T., they can't change "signed" back to .F. to make an unauthorized change.

                              Unfortunately, nothing prevents a user with access to the control panel and to the field rules from opening the control panel and changing the field rules temporarily. So you have to make sure the control panel is hidden and that the table is encrypted, so that a user cannot buy a copy of Alpha Five, open the table and make changes.

                              Comment

                              Working...
                              X