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

A few record locking questions

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

    A few record locking questions

    I read in the documentation that it's a good idea to turn off Windows opportunistic record locking if you have an A5 multi-user app running on XP or Win2003 server. I'm concerned about doing this because I have people using a SQL db with a non-A5 app and I don't know how this might affect them. Does anyone have any experience with this?

    Also, I have a form based on a set. The users are working with different parent records, so most of the tables in the set would not be triggering a record locked error. But there are a couple of tables, one linked to the parent & one to the child, that are reference tables. They basically provide descriptions for numeric codes, prevent the user from entering an invalid code, and define some conditional processing. The details are irrelevant, but the point is that multiple users may be accessing these tables but NOBODY is ever writing to them in this particular form. Since the users have occasionally gotten record locked errors, I'd like to make these 2 tables read-only so that no locking would happen. I just can't seem to find an action script to make a table readonly. It's easy to make a field readonly, and even an entire browse, but not a table. I'm sure there must be a way to do this...

    And finally, if I created a shadow db on the user pc's, would that have any affect on record locking?

    #2
    Re: A few record locking questions

    Can anyone offer any info on this? The record locking problem in this app is really getting in the way and I'm not sure where to go with this. I've tried the documentation but I don't see anything that describes my situation.

    Comment


      #3
      Re: A few record locking questions

      I am going to respond only because no one else has (i.e., I am no authority on your main question).
      Originally posted by Reva View Post
      I read in the documentation that it's a good idea to turn off Windows opportunistic record locking if you have an A5 multi-user app running on XP or Win2003 server. I'm concerned about doing this because I have people using a SQL db with a non-A5 app and I don't know how this might affect them. Does anyone have any experience with this?
      I have no experience with this issue but it is a very good question. If you find an answer, let us know (it is essentially a SQL DB question, assuming both DB's were on the same server).

      Originally posted by Reva View Post
      Also, I have a form based on a set. The users are working with different parent records, so most of the tables in the set would not be triggering a record locked error. But there are a couple of tables, one linked to the parent & one to the child, that are reference tables. They basically provide descriptions for numeric codes, prevent the user from entering an invalid code, and define some conditional processing. The details are irrelevant, but the point is that multiple users may be accessing these tables but NOBODY is ever writing to them in this particular form. Since the users have occasionally gotten record locked errors, I'd like to make these 2 tables read-only so that no locking would happen. I just can't seem to find an action script to make a table readonly. It's easy to make a field readonly, and even an entire browse, but not a table. I'm sure there must be a way to do this...
      Why can't you just set the form properties (in design mode) to restrict entering or changing records? Then if you wanted you could create a password protected button on your form, use xbasic and put in the following:
      Code:
      topparent.restrict_enter=.f.
      topparent.restrict_change=.f.
      Then users would not be able to make any changes or enter new records unless they know the password for your button. Unrestricting these things would be effective only for the one user and would go back to be restricted for that user the next time they open the form. If you wanted you could even create another button to put the restrictions back (=.t.) for the user who undid them--could even be on the same button if you wanted to get semi-clever.

      As for making the table read only, I know of no way to do this even using xbasic (though there is bound to be a way!). Manually you could get to the dbf table in whatever Windows utility you use to get to files (e.g., Windows Explorer), right click on the file and make it read only. Seems unwieldy though. I would do what I suggested at the form level.

      Originally posted by Reva View Post
      And finally, if I created a shadow db on the user pc's, would that have any affect on record locking?
      None.

      Ray

      Comment


        #4
        Re: A few record locking questions

        Thanks for your reply, Ray. The problem is that the users need to be making changes all the time. That's the point of the app. The only table in the set that they DON'T need to change is also the only one where they're likely to be accessing the same record & locking each other out. That table is only used for calculations & as a pull-down. There's no way for them make any changes to it in the form. It seems that there ought to be a way to specify that this one table shouldn't be locked, but I can't find it. Interestingly enough, we didn't have this problem with this same app in version 8, so now I'm wondering if this might actually be a bug?

        Comment


          #5
          Re: A few record locking questions

          Reva,
          If this is for sure the way you want to do this and no xbasic function is present then making a file (or folder with files) readonly is fairly easy to do. A .vbs file can be created and then with xbasic opened to make whatever file is indicated within the vbs file a readonly....or whatever attributes you would want really. I can do it in just a minute or two if you know the path to the file---a bit longer if you need it to be a bit more generic with a5.get_path() (or a5.get_master_path() for network server).

          The one time I figured this out for a similar case Alpha ended up having a function already for it and do believe a different way ended up being used instead. Just let me know.
          Last edited by MikeC; 06-04-2008, 06:45 PM. Reason: typo corrections
          Mike
          __________________________________________
          It is only when we forget all our learning that we begin to know.
          It's not what you look at that matters, it's what you see.
          Henry David Thoreau
          __________________________________________



          Comment


            #6
            Re: A few record locking questions

            Hi Mike,
            The file will always be in the same directory with the other files, but I do need that directory to be able to change, just so that I can test things on my laptop. So if what you'd be writing can't just default, I guess you'd need to get the network path since this is a network setup. It seems to me that there ought to be an A5 function for this, but I just haven't been able to find it. I'd love to see your script. The table name is CallResult. Do you need more info from me?

            Comment


              #7
              Re: A few record locking questions

              Originally posted by Reva View Post
              Thanks for your reply, Ray. The problem is that the users need to be making changes all the time. That's the point of the app. The only table in the set that they DON'T need to change is also the only one where they're likely to be accessing the same record & locking each other out. That table is only used for calculations & as a pull-down. There's no way for them make any changes to it in the form. It seems that there ought to be a way to specify that this one table shouldn't be locked, but I can't find it. Interestingly enough, we didn't have this problem with this same app in version 8, so now I'm wondering if this might actually be a bug?
              Sorry, I misunderstood your issue. It sounds like those one or two tables do not really need to be part of the set (maybe a separate lookup for the pull down and/or just pull values into variables to use for other things). However, this should not be necessary, especially if there were no problems using v8. You could send off a sample app to Alpha, but if this is something that can only happen when several users are using it, I doubt Sewlyn and crew are going to be able to find the problem.

              Ray

              Comment


                #8
                Re: A few record locking questions

                Reva,

                It sounds like you just need to be able to make the table read only on your server correct? And on your laptop. In other words, if the table is to be set to read only on the computer you will be currently using then this would do it I believe. Place wherever, button, autoexec, etc...

                Code:
                 
                dim dbpath as c
                dbpath=a5.Get_Path()+"\\"
                dim fil as p
                 
                fil=file.create(dbpath+"VB_Read_Only.vbs",FILE_RW_EXCLUSIVE)
                fil.write_line("Const ReadOnly = 1")
                fil.write_line("Set objFSO = CreateObject(\"Scripting.FileSystemObject\")")
                fil.write_line("Set objFile = objFSO.GetFile(\""+dbpath+"CallResult.dbf\")")
                fil.write_line("If Not objFile.Attributes AND ReadOnly Then")
                fil.write_line("    objFile.Attributes = objFile.Attributes XOR ReadOnly")
                fil.write_line("End If")
                ''Next is to have the .vbs file actually change the readonly attribute.
                xbasic_wait_for_idle()''used as created in version 5....ui_yield() could most likely to be used in version 8
                sys_open(dbpath+"VB_Read_Only.vbs")''this acts just like if you doubleclicked on the file which plays the .vbs script.
                fil.flush()
                fil.close()
                If you would want to just have the script toggle the read only value then change the
                Code:
                fil.write_line("If Not objFile.Attributes AND ReadOnly Then")
                fil.write_line("    objFile.Attributes = objFile.Attributes XOR ReadOnly")
                fil.write_line("End If")
                to simply
                Code:
                fil.write_line("    objFile.Attributes = objFile.Attributes XOR ReadOnly")
                Mike
                __________________________________________
                It is only when we forget all our learning that we begin to know.
                It's not what you look at that matters, it's what you see.
                Henry David Thoreau
                __________________________________________



                Comment

                Working...
                X