Page 1 of 3 123 LastLast
Results 1 to 15 of 36
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    split database

    i have a database that is on a shared network at work. normally i get on it occasionally on sundays since no one is on it and run my compact and repair but for some reason this week i was not able to get on the network. guess what, i come in to work this morning and several of the front ends would not work. i spent the next hour calling people all across the country trying to get them out of their front ends so i could do a compact and repair during working hours. is there a way to send out a message box message to all the front end databases that would display a message asking them to exit the program? i would love to have the database set up to automaticly run maintenance at night on its own but my understanding is that you have to have a computer logged in during that time to perform it. any help would be appreciated thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You can have a PC on all night ,the form open that has a timer.
    at the time, it can compress the db. You don't have to be logged in to do it manually.

  4. #4
    RayMilhon is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,071
    I use the task scheduler on my PC. I leave my PC logged in but the screensaver is turned on to require a password if anyone tries to access it. The task scheduler is set to run the backend Access Database at 10:00 PM when no one is logged in and the autoexec macro is set up so that if the time is between 10:00 PM and 10:30 PM the compact and repair runs and the database shuts down. It the database is opened at any other time it does nothing.

  5. #5
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks guys. i'll look into the suggestions. Paul, i looked at the software you mentioned but i did not see anything about being able to message to the individual front ends?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No, that link was for a method to kick people off after a period of inactivity. You could message front ends with a backend table that holds the message and a timer event that checks that table in a front end form that stays open. Problem is if they don't respond (left for the day), which is why I thought the "force them off" option might be preferable.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    just got home so that I could try the code that you suggested Paul and it works great ,except, if the computer is locked for inactivity by windows, it does not shut down access(our work computers lock after a few minutes of inactivity). one of the issues that I see, especially on the weekend when I am wanting to do something to the backend file is that a user forgets to close access and locks the computer thinking all was good till Monday. I log in on Saturday and some wonderful employee in another state has locked me out of making changes that I had planned. is there a way or method to alter this software/code to shutdown while the computer is locked or is that just a Microsoft windows thing?

  8. #8
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I built an application that had a hidden form with a timer event, the frequency was read from a table. The timer event looked for a hidden file in the db folder. If found, the timer event opened a form telling users to get out within x minutes, x being the start value from said table. The timer event subtracted the interval from the start value on each cycle and repainted the form, and if it got to 0 or less, I called the shutdown routine, which ended with Application.Quit. The file could only be created by an admin level user by clicking the Lockout command button. A user could not enter the db if the file existed. Did it work on a locked computer? I have to confess that I never tried it but don't recall having to call anyone to get out if I invoked it. On other databases, I've had to get a network administrator to shut someone down by them using the computer management console.

    I think there is more than what first meets the eye here. If all you want to do is run a compact and repair, why not do this automatically on shutdown IF the file size exceeds a certain value and IF it has not already been done that day (one or two table values)? Then it will happen daily when larger than the set size. As for running stuff at night, Windows Task Scheduler works great. I have even put a switch in the command line to tell the database if it was a user or a stand alone computer we had with a generic account in a locked room. Thus the full startup routine ran, or it didn't (no need to do all the user login/permissions stuff).

    Another thing to check is, do they really have it open, or did they force an abnormal shutdown and you have leftover lock files (e.g. *.ldb)? You can try deleting locked database file as long as you don't have the db open.

    Another approach you can take: a front end for each user with a version number. It checks your backend version table number and if not the same, user has to close it and download a new one. You could at least make your changes in your template version (which leads me to ask why you cannot "work" on the FE - surely you are not changing the live version??) and publish your changes with a new version number. Or are these changes taking place in the BE? I'm not 100% clear on which it is you're trying to work on, but I get the impression it's only a matter of doing a compact on a shared FE.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks Micron. I only started learning databases a short period ago so i'm basicly learning as I go or for that matter as things break. the auto compact and repair based on file size sounds like a good idea along with the FE with a version number that checks backend version. are there any articles or samples that you know of that I can look at?

  10. #10
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    My shutdown routine is in mdlStartup - just ended up that way. Near the end, it's called by the line 'AutoCompactCurrentProject'. Application.Quit follows it.

    Code:
    Public Function AutoCompactCurrentProject()
    Dim fs, f, S, filespec
    Dim strProjectPath As String, strProjectName As String
    
    strProjectPath = getApPath
    strProjectName = getApName
    
    filespec = strProjectPath & "\" & strProjectName
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(filespec)
    S = CLng(f.Size / 1000000)  'convert size of app from bytes to Mb’s
    If S > 6 Then
    'set autocompact property to compact on close
        Application.SetOption ("Auto Compact"), 1
    Else
        Application.SetOption ("Auto Compact"), 0   'don’t compact app
    End If
        
    End Function
    above calls these two functions

    Code:
    Function getApPath() As String
    
    getApPath = CurrentProject.Path
    End Function
    
    Function getApName() As String
    
    getApName = CurrentProject.Name
    End Function
    I don't have anything on the version idea. It was told to me by a workmate, but the gist of it is, when you edit your FE, you hard code the version number in the startup routine and compare to the BE table version value, which you must alter after every update. If matched, you allow entry. If not, you don't, but what information you present at that point depends on how you manage the rest of the process (i.e. if it's a single shared FE vs they each have their own; ability to install files, etc). Because the FE version number is hard coded, I suppose there's no way around having to get a new file if you want in.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by vicsaccess View Post
    just got home so that I could try the code that you suggested Paul and it works great ,except, if the computer is locked for inactivity by windows, it does not shut down access(our work computers lock after a few minutes of inactivity). one of the issues that I see, especially on the weekend when I am wanting to do something to the backend file is that a user forgets to close access and locks the computer thinking all was good till Monday. I log in on Saturday and some wonderful employee in another state has locked me out of making changes that I had planned. is there a way or method to alter this software/code to shutdown while the computer is locked or is that just a Microsoft windows thing?
    I haven't needed to use this, but it sounds like a Windows thing. I normally use SQL Server so I don't need people out to do most things.

    Are you trying to make changes to the front end or back end? Getting people out should only be an issue for making changes to the back end. To address the version issue being discussed, I use a version table in the front end. Each new version gets a higher version number, date and description of the changes made (the latter simply for my use). Users don't actually start my programs, they start a version control utility that checks the version on their PC against a master version on the server. If the server version is later, the utility downloads it, then either way runs the local copy.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    I'm liking the version checker ideal. currently, and again I'm going to use my best excuse that I'm learning as I go or break it, I'm on a network at work so my BE is in a folder that I don't make publicly known, then each machine around the country has a FE that is kept on the network that they have a shortcut to, I would have loved for them to put the FE on their computers but I did not know how I would be able to update the individual FE's with changes so I left them where I could get to them on the network. to answer you question Paul, normally i only have to make small changes to the FE and then occasionally compact and repair the BE. this time it crashed on me Monday morning which started this post, i got everyone out, compacted and repaired the BE, let them back in, it crashed again so i did it again last night and tested each FE, went to work this morning and it crashed again. from the errors that they were getting all the articles tell me it was probably a network error or corrupted FE so this time afternoon i repaired the BE and then compacted and repaired each FE and let them in one at a time trying to narrow it down to a location or computer. so far tonight its still working. do you have a sample DB with your version control utility that i could look at? i'll look around the pages and see if there are any articles or samples i can find. thanks for all of your help.

  13. #13
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    then each machine around the country has a FE that is kept on the network that they have a shortcut to
    Not really clear on your setup.....
    It sounds like you are running Access over a WAN...?? (Access FE <--> WAN <--> Access BE)



    If yes, you should read this article by Albert D. Kallal: http://www.kallal.ca/Wan/Wans.html

    Pay attention when you get to a header (approx 1/3 of the way down):

    This network story gets worse!

    and

    Why a does JET file share corrupt when the connection breaks?



    It is not advisable to run Access over a WAN, especially when the BE is an Access file.
    Something to be aware of....

  14. #14
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks Steve, very interesting article. obviously i can't change our network but find options to deal with it. not sure that it would be considered a WAN but it is definitely on the slow side.

  15. #15
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by vicsaccess View Post
    do you have a sample DB with your version control utility that i could look at?
    Sorry, I don't. It used to be an Access file but now I write them in VB6, as I figure an exe will load a little faster than an Access db. Basically I open a recordset on the local copy's version table and the network copy's and compare them. It does more, like handling the first time when the local copy doesn't exist, but that's gravy. Bob has a utility here:

    http://btabdevelopment.com/free-access-tools/

    Bill has a different method here (the first item):

    http://www.thatlldoit.com/Pages/howtosarticles.aspx
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-27-2013, 09:51 AM
  2. Should i split the database
    By tagteam in forum Database Design
    Replies: 4
    Last Post: 05-20-2013, 12:04 PM
  3. Split Database
    By gbwiii in forum Database Design
    Replies: 4
    Last Post: 05-20-2011, 09:55 AM
  4. Split Database.
    By cvolkers in forum Programming
    Replies: 3
    Last Post: 09-09-2010, 11:52 PM
  5. Split Database
    By pthoopth in forum Database Design
    Replies: 3
    Last Post: 11-09-2009, 03:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums