MS Access Forum / Replication / June 2005
question
|
|
Thread rating:  |
Bill H. - 10 Jun 2005 06:43 GMT question: I'm using the access toolbar (tools, replication, etc.) to manually sync. How do I create a button on a form to do this?
And, how do I have it try to sync with all 8 databases even if all 8 are not available at the time? I expect only one at a time to be available (using memory sticks), but want to keep it simple for the user.
 Signature Bill
David W. Fenton - 10 Jun 2005 17:05 GMT > question: I'm using the access toolbar (tools, replication, etc.) > to manually sync. How do I create a button on a form to do this? [quoted text clipped - 3 lines] > be available (using memory sticks), but want to keep it simple for > the user. You *can't* use memory sticks (or USB thumb drives) unless they will only ever be plugged into a single computer. This is because if you plug it into a different PC and open the replica or synch with it, its replica ID will be changed (since it has a different name, as the name of the replica includes the computer name).
This is no different than copying a replica to a floppy disk.
Replication only works with networking and in-place replicas. Anything else will cause you to end up with dead replicas and that will eventually lead to replication errors that may not be resolvable, and after that, to complete data loss of either an individual replica or corruption of the whole replica set.
 Signature David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
Bill H. - 11 Jun 2005 07:27 GMT Hm. OK, what if we give each computer the same name? Would the memory sticks work OK then?
And what good is replication if all the replicas have to be on the same network? May as well just be one database then, IMHO.
I saw something in help, I think, that mentioned having a desktop and laptop (similar to what I'm trying to do, it seems) and being able to sync in that situation.
And if none of that works, how about connecting the laptops to a LAN and syncing that way, and then send the laptops back into the field? Quite a bit of bother (and what to do with those locations that don't have laptops), but maybe a solution?
What other solutions might there be?
Thx.
Bill
David W. Fenton - 11 Jun 2005 20:02 GMT > Hm. OK, what if we give each computer the same name? Would the > memory sticks work OK then? Well, yes, that's a workaround for it, but then you can't connect them to the same network.
> And what good is replication if all the replicas have to be on the > same network? May as well just be one database then, IMHO. They don't have to be on the same network all the time, they just need to be connected to the same network occasionally.
And, well, whether or not you can see the logic of it, that's the way Jet replication works.
> I saw something in help, I think, that mentioned having a desktop > and laptop (similar to what I'm trying to do, it seems) and being > able to sync in that situation. No network? I'd be interested in seeing it -- I actually believe you misinterpreted what you read.
Of course, Microsoft has a history of providing erroneous or misleading documentation for replication, because a lot of it was written before very many people were actually using it and finding out what the problems were.
> And if none of that works, how about connecting the laptops to a > LAN and syncing that way, and then send the laptops back into the > field? Quite a bit of bother (and what to do with those locations > that don't have laptops), but maybe a solution? That's the solution.
Or a WAN.
> What other solutions might there be? LAN or WAN or dialup (which is a form of LAN).
With a LAN connection, you can use direct replication, via the Access UI.
With any other method you can't use that, because it opens both files across the connection, and the connection is too slow to be reliable and will, inevitably, corrupt one or more of the replicas (usually the one opened remotely). This usually corruption causes no data loss, but it usually causes the replica to lose replicability, which is almost as bad, since you than have to recover the data manually (unless you're using Replica Farms, as recommended by Michael Kaplan at http://www.trigeminal.com).
For a WAN or dialup situation, you need to use indirect replication (you could also use Internet replication, but it requires IIS running on your central server and on all the remote machines, so in my opinion, is both an enormous security risk, as well as an administrative nightmare that is difficult to keep running reliably). This requires the use of Replication Manager, or something like the TSI synchronizer along with a component of ReplMan. ReplMan is included in the developer tools (though I hear it's not included in the A2K3 developer tools, because MS is stupidly promoting the broken and incomplete JRO for replication, instead; JRO is a consequence of the ADO insanity that MS introduced with A2K, stupidly recommending that developers abaondon the tools native to Jet for something that has fewer features for Jet and works more slowly than Jet's native DAO; but I digress).
The way indirect replication works is that a synchronizer runs on the server and on the remote computer. When the remote computer connects to the network, its synchronizer communicates with the remote synchronizer and they determine what needs to be exchanged. Then a series of relatively small files are sent back and forth, including only the delta between the two replicas. That is, only the changes have to travel across the wire, instead of the whole file as occurs with direct replication.
That's the basic architecture.
It requires certain things:
1. you have to set up dropboxes on the computers on each end, and those dropboxes have to be accessible via network shares that allow the remote machine to read/write to that share. This means you have to give EVERYONE access (which is not at all recommended), or that you need to have the remote PC authenticating against the same domain as the central computer, or (if there's no domain controller) you need to have the remote computer running the process under a user logon that has the same name and password on the central computer. This is, perhaps, the trickiest part for Access developers, as most of them are clueless about Windows security and networking.
2. the networking has to be set up right, as well, which today with firewalls can be something of a difficulty. The easiest solution for this is VPNs. Just in the last couple of weeks, I've implemented replication over the Internet using the built-in Win2K VPN support (you set up the VPN host connection on one computer, and then configure the VPN connection at the remote computers; it's very similar to dialup networking, but instead of a dialup connection, you get a private tunnel across the Internet; this means bigger bandwidth than dialup if you have broadband on both ends). Once the VPN is up, it's as though you're connecting to the LAN, just not as fast. You need to use indirect replication, but in terms of access to the remote computer/network, it's no different (i.e., you can use network neighborhood and UNC names, even mapped drives, to navigate around the servers on the other end).
3. on either end, there has to be a replica that is "managed" by replication manager. I always make this a replica separate from the one used for data entry. You may also want to have more than one replica managed by the synchronizer with a synch schedule so that any single replica could corrupt but you'd still have other good replicas with identical replicas (that's the "replica farm" concept I referred to above). ReplMan can set up scheduled synchs between the managed hub and the production replica, though the shortest interval available is 15 minutes. I would expect that for any application where thumb drives, etc., are OK, that would be sufficiently often.
A few other bits and pieces:
1. as with all replication, the design master should not ever be used for data entry. It should be stored away somewhere on the LAN that is safe and synched with the actively edited replicas on a regular schedule to prevent it from expiring (e.g., once a week/month).
2. scheduled replication requires certain changes to your front end application, because it will happen while people are editing data. The main problem is that if a synch happens while someone is editing a memo field, it can corrupt the memo field, causing it to lose its pointer and usually causing the loss of the record it's attached to. This can be avoided by never using bound fields for editing memos. Instead of setting a controlsource for your memo, instead, copy the data from the underlying memo field from the form's recordsource into the unbound control. And in the control's AfterUpdate event, write it back to the recordsource. That would look something like this:
In the form's OnCurrent:
Me!fldMemo = Me!Memo
In the memo control's AfterUpdate event:
Me!Memo = Me!fldMemo
If you have mutliple memos, you'd want to assign all of them in the OnCurrent event.
 Signature David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
Bill H. - 12 Jun 2005 05:55 GMT well, that certainly is a lot to know and think about!
Thanks for your time.
> > Hm. OK, what if we give each computer the same name? Would the > > memory sticks work OK then? [quoted text clipped - 145 lines] > If you have mutliple memos, you'd want to assign all of them in the > OnCurrent event. Bill H. - 15 Jun 2005 19:48 GMT Hi.
If I take the approach of renaming the "remote" (and not connected to any network) computers to all have the same name, do I need to also worry about which version of Windows they may have installed?
And does replication truly use only the computer name, or does it also (or instead) use some GUID thingy? :-)
Thanks.
Bill
David W. Fenton - 16 Jun 2005 01:58 GMT > If I take the approach of renaming the "remote" (and not connected > to any network) computers to all have the same name, do I need to > also worry about which version of Windows they may have installed? I don't think that should make a difference.
> And does replication truly use only the computer name, or does it > also (or instead) use some GUID thingy? :-) I uses the machine name and the local path. This means that all the thumb drives need to have exactly the same drive letter.
Now, I think what you're doing is a HUGE MISTAKE. You are circumventing the architecture of replication in order to work around YOUR WRONG-HEADED METHODS.
Keep in mind that only one of these machines with the same name will be able to be plugged into the LAN at any time. That seems like a really inconvenient limitation of your silly workaround.
Fix the replication architecture -- every machine should have its own replica that synchs with other replicas when each machine is connected to the network.
If you *can't* connect to the network, then YOU CAN'T USE REPLICATION.
Sorry, but that's really the bottom line.
 Signature David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
Bill H. - 16 Jun 2005 07:29 GMT Well, I guess I'm at the bottom then, because these machines will never be connected to a network, and I don't know how else to handle this.
The client won't go with web-based application, and won't provide VPN (or any other access) for the remotes to any "mother ship."
Other ideas?
Bill
David W. Fenton - 16 Jun 2005 20:51 GMT > Well, I guess I'm at the bottom then, because these machines will > never be connected to a network, and I don't know how else to > handle this. Are they connected to the Internet?
> The client won't go with web-based application, and won't provide > VPN (or any other access) for the remotes to any "mother ship." > > Other ideas? Depending on the infrastructure, a VPN is not that big a deal.
Absent that, you could delve into Internet replication, but that requires IIS running on the central server as well as on all the remote machines.
If none of these are going to work, then the client is going to have to pay for a manually-written synchronization, not using replication at all. That is very, very hard to write and very complex. It will costs tens of thousands of dollars.
The alternative is spending a couple hundred for a VPN solution so you can use Jet replication (indeed, some $75 Linksys routers have VPN support built in).
Seems like a no-brainer to me, but I recognize that in some organization, brainlessness is a deciding factor for promotion. ;)
 Signature David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
Bill H. - 18 Jun 2005 22:27 GMT Thanks.
Yes, the remotes are likely internet-connected, one way or another.
I'm trying to push for the vpn-link. If that actually happens, can I "un-replicate" the database, or do I even need to?
--Bill
David W. Fenton - 19 Jun 2005 00:24 GMT > Yes, the remotes are likely internet-connected, one way or > another. > > I'm trying to push for the vpn-link. If that actually happens, > can I "un-replicate" the database, or do I even need to? No, you can't possibly edit the database across the Internet, so replication will be required.
Also, consider the costs of maintaining an always-on Internet connection. If someone is travelling with a laptop and staying in hotels, that could be very expensive.
On the other hand, if this is something you're contemplating as a reasonable scenario (always-on Internet connections), then you should consider avoiding replication and hosting the application on Windows Terminal Server in the home office. The remote users would then be running the application in the home office at all times.
However, the disadvantage of that is that there is no way to view or edit the data if the remote user is not connected.
 Signature David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
Bill H. - 19 Jun 2005 18:03 GMT yeah, there is a very remote possibility of them doing a terminal server. Not being able to edit the db without an internet connection is, at this point, not a problem for them.
But reading between the lines, are you saying that using terminal server AND replication would work? Using the vpn to sync and the replication so they can be mobile with the db?
That could be very nice. :-)
ps. and why can't one "edit the database across the internet?" are you making a distinction between "internet" and VPN? I've edited several access dbs via the slow likes of pcAnyWhere on dialup, even. :-)
Bill
David W. Fenton - 19 Jun 2005 20:52 GMT > yeah, there is a very remote possibility of them doing a terminal > server. Not being able to edit the db without an internet [quoted text clipped - 3 lines] > server AND replication would work? Using the vpn to sync and the > replication so they can be mobile with the db? No.
They are two separate issues.
VPN: A VPN provides an Internet-connected user with a connection to the homebase that runs Windows networking, and can thus support communication between two synchronizers. This means you're on the home network, though at a relatively low bandwidth with high latency. Because of these last two, you can't run Access like you can on a LAN, but it works extremely well for indirect replication. Absent a VPN, indirect synchronization over the Internet requires Internet replication, which involves running IIS on the home server and on all the remote machines. It means keeping the FTP servers on each of these machines functioning correctly. To me, IIS is a massive security hole, so I don't want it running anywhere. It also adds yet another component that has to be managed and kept running properly so that your synchronization doesn't faile.
WTS: with a Windows Terminal Server, all those problems are absent. The user is running the Access application in the RAM of the server at homebase, with her own desktop (and her own copy of the front end) and all edits are real time on the home copy of the data file. Replication is not needed at all for this scenario, since there's only one authoritative data file in use, the one that is used by the people in the home office (which now includes the remote users who are running the app on the WTS).
Now, I would recommend for security purposes that you run a WTS behind a firewall (i.e., the WTS port is *not* exposed directly to the Internet), and require that remote users connect to the VPN, which puts them *inside* the firewall to connect to the WTS machine.
But many people in comp.databases.ms-access consider this too much trouble.
I think those people are complete fools, however.
An open WTS port is an open invitation for somebody to try hacking your network. A VPN is much safer, as it requires authorization and certificate exchange (assuming you're using something more robust than the Windows VPN client in its default configuration, which isn't secure -- you have to turn on IPSEC). The VPN also has advantages to the remote user that WTS without VPN does not, such as access to network resources across the VPN (i.e., you can copy files from your remote machine to the home network and vice versa; this is not supported with WTS alone).
> That could be very nice. :-) > > ps. and why can't one "edit the database across the internet?" > are you making a distinction between "internet" and VPN? I've > edited several access dbs via the slow likes of pcAnyWhere on > dialup, even. :-) That's not running it across the Internet -- that's the same as Windows Terminal Server, because the copy of Access that's editing the data is in the RAM of the machine where you're accesing the data.
What I mean is this:
1. server in home office.
2. laptop remote, connected to home office by Internet connection.
3. Access front end MDB on laptop with linked tables that point to a data file on the server in the home office.
This can be done, but:
1. it is very, very, very, very, very, very, very slow in comparison to even the slowest LAN (compare 10Mbps to a T1 at 1.5Mbps both ways to a typical ADSL connection which is, perhaps, 1.5Mbps download but 384K upload; do the math and then multiply by 10 for the LAN to compare it to the typical 100Mbps LAN).
2. it is very, very, very, very, very, very, very unsafe because a dropped connection can every easily corrupt your data file. If the Internet connection is lost or times out, it is no different than if on a LAN somebody pulled the LAN cable while in the middle of an edit.
All the solutions to this problem involve removing the requirement to move the data across the Internet, either by making it local (via replication) and pushing only changes across the Internet at appropriate times. This has the advantage of being efficient, but has high latency in terms of everyone seeing everyone else's changes. With many applications, that is not really a problem, because many times users are concerned only with their own data.
The other way to remove the requirement of moving the data across the Internet is to run the whole application remotely, as with PCAnywhere or WTS. PCAnywhere is not multi-user, and is not using native Windows graphics calls, so it's not appropriate (it requires one dedicated PC in the home office per remote user, and is much, much slower than WTS; it also often makes a PC unstable because of its installation requirements).
WTS, on the other hand, was designed from the ground up to support multiple users. It also works by sending only the Windows graphics commands across the wire, the same information that is sent from the Windows kernel to your graphics card at a local console, so it's very efficient, especially with broadband.
Some issues with WTS:
1. hardware: you need quite a bit of it. I tend to spec out 128MBs of RAM on the terminal server per simultaneous user. That means if you want to support 5 people running at a time, you need at least 640MBs of memory available for the WTS users. That means you need to start with at least about 1GB of RAM for a terminal server that you want to serve 5 users simultaneously. This level of RAM in servers has become very cheap. A client of mine put in a dedicated terminal server last winter for less than $2,000 with 2GBs of RAM, and it was a nice Compaq rack server, so they didn't do it on the cheap, either.
2. licensing: remote users must have compatible licenses on their remote machine for the software they want to run on the terminal server. That means that if they want to run Access on WTS they need to have Access installed on their laptop. It's not quite that strict, though -- there seem to be certainly cross-compatibilities, especially between versions (you don't have to have the exact same versions installed on both ends), and, perhaps, between the Office suite as a whole (I don't know the details on this, as I've never tried to set this up with anything other than full Office on all the remote machines). You also have to buy client access licenses to install on the WTS, but these cost only $30-40 apiece, so that's not a very high cost.
3. printing: with Windows 2000 Server, there is no remote mapping of printers without buying the Citrix extensions. What this means is that a remote user running on WTS can't print to her local printer, unless you buy the Citrix extensions for this. Windows 2003 Server adds pretty good support for this, as long as the printer drivers for your local printer are already installed in W2K3 Server. When that's the case, your local printer is automatically detected in your WTS session and mapped as your default printer -- you don't have to do anything. However, if you have a printer that's newer than the release of W2K3, the drivers need to be installed on the W2K3 server in order for you to be able to print to your local printer. Surprisingly, this is much less of an issue than I had every suspected it would be, but it depends entirely on what kind of printers your remote users have. I don't know about whether or not you can print using compatible older drivers or not, as none of my users has ended up with a problem so far (my latest client with this was lucky in having the remote printers at their 5 sites all being the same model, so they just installed the drivers for that one model on their terminal server and everyone was OK).
4. deployment of the app: there are no differences running on terminal server than in a regular configuration. You supply each users with an individual copy of the front end MDB, which is stored in the user's profile on the terminal server box. You may have to futz around with some registry keys to turn off the macro security notifications (I did it with one key), and you may have some difficulties on Win2K3 Server if the user tries to execute UNC paths (Win2K3 thinks they are Internet sites and gives you a warning until you put the machines in their Intranet security group in Internet Options; yes, this is a stupid situation, as Win2K3 Server ought to be smart enough to detect machines on its own LAN segement -- it can't even recognize a UNC path that refers to *itself*; that is, if you're terminal server is called \\Server and your Access database is in D:\Data\AccessDBs on that server, D:\Data\AccessDB\MyDB.mdb is OK, but \\Server\AccessDB\MyDB.mdb provokes an Internet warning; yes, you read it right, and yes, it's very stupid). The easiest way to automate distribution of the front end to new users is to use Tony Toew's Auto Front End Updater for this purpose, found at http://www.granite.ab.ca/access/autofe.htm . It's a little tricky to set up (though much simpler than it used to be), but once working, it's transparent to the users.
But, again, if anyone needs to update data when they *don't* have an Internet connection, replication is going to be needed anyway.
However, the number of clients I have who need replication these days is much fewer than it used to be. Indeed, the cases where I used replication so that my clients could have multiple offices have all been replaced with WTS solutions. I now use replication only to support wandering users with laptops.
 Signature David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
|
|
|