MS Access Forum / Replication / November 2003
how to : bring a damaged(?) replica back to replication ring ?
|
|
Thread rating:  |
marc_selles - 19 Nov 2003 10:15 GMT Hello
( sorry to re-post, my previous posting from 2003-11-13 disappeared from this list ! )
maybe someone can help :
- I have a replica which no longer has DesignMasterID, that is : debug.print CurrentDb().DesignMasterID --> nothing ! debug.print CurrentDb().ReplicaID --> { good-looking guid } though it still has all replica tables and replica fields... so when I manually try to synchronize, I get an error msg.
- I do have the design master mdb, and 1 other functional replica from which I can obtain the good DesignMasterID
- only this one has been damaged somehow ... of course it's one with many important records
Please don't tell me I have to write 100s lines to copy lost records to a valid replica ( would be very long cause it's heavily relational using record IDs)
Thanks in advance Marc
Michael \(michka\) Kaplan [MS] - 19 Nov 2003 15:48 GMT There is no way to do this --- once a db has replication removed due to corruption, it cannot get it back.
Note that you should NEVER be making data changes in the design master, which is the most volatile member of the set since it goes through the most marked changes and has enough to worry about without adding such a burden.
 Signature MichKa [MS] NLS Collation/Locale/Keyboard Development Globalization Infrastructure and Font Technologies
This posting is provided "AS IS" with no warranties, and confers no rights.
> Hello > [quoted text clipped - 21 lines] > Thanks in advance > Marc marc_selles - 20 Nov 2003 11:18 GMT Michael,
Thanks for answer, even if it's worst news ! ( The design master is not part of 'replica ring', & I had zipped it in a safe place, just in case...)
I guess I have to code now, The problem : there are many relations, I used for relation housekeeping AutoNumber fields --> when copying a record, I cannot force Access to create a record with the 'old' autonumber value so for each table I must create a temp 'correspondence' table with old/new autonumbers then update ID fields in all the 'many' side tables ...
Do you know of any code framework to do this recursive copying from damaged data to a functional replica ? Thanks Marc
PS Michael, sorry for sending this answer first to your own mail address - I hit the wrong button in Outlook express/XP which hides part of text under its 'big' icons
>"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> a ?crit dans le message de news: OqbBXSrrDHA.2348@TK2MSFTNGP09.phx.gbl...
> There is no way to do this --- once a db has replication removed due to > corruption, it cannot get it back. [quoted text clipped - 36 lines] > > Thanks in advance > > Marc Tom Trosborg - 20 Nov 2003 15:54 GMT Just one quick word, FWIW: I don't use auto-numbering, but generate my own unique record IDs (eg computername plus time; there are many algorithms, but don't use GUIDs). Then copying data into a new database is really easy.
HTH, Tom Trosborg.
> Michael, > [quoted text clipped - 63 lines] > > > Thanks in advance > > > Marc marc_selles - 22 Nov 2003 16:08 GMT thanks, Tom
...I'm afraid it's too late for this time ! Marc
> Just one quick word, FWIW: I don't use auto-numbering, but generate my own > unique record IDs (eg computername plus time; there are many algorithms, but [quoted text clipped - 75 lines] > > > > Thanks in advance > > > > Marc Michael \(michka\) Kaplan [MS] - 23 Nov 2003 03:34 GMT "marc_selles" <marc.selles@nospam-wanadoo.fr> wrote...
> thanks, Tom > > ...I'm afraid it's too late for this time ! Hi Marc,
It is also too late for easy solutions to getting the data out. The advice you have been given in this thread by me and by Tom are to make it so it will be easier if its happens again. But its pretty hard to unbreak the eggs once they are scrambled....
 Signature MichKa [MS] NLS Collation/Locale/Keyboard Development Globalization Infrastructure and Font Technologies
This posting is provided "AS IS" with no warranties, and confers no rights.
marc_selles - 24 Nov 2003 18:07 GMT Thanks, Michael I'll have to 'unscramble' anyway, will do that tomorrow. Just wondering : since autonumbers are so much in use (even if evil in a replicable word) then *how* on earth does the synch processing solves the dilemna :
say we are inside a northwind-type db : - customerZ is created inside replicaB with a brand new 'AutoNumber' customerID value , say -2111111111 - inside replicaB, this autoNumber is used to coin every order pertaining to customerZ , say in a customerID field in tblOrders - now when synching orders+customer back into replicaA what happens ? the only choice is to keep -2111111111 as customerID ....but is not this against 'random' AutoNumbers inside replicaA ????
Wish I could do that in my code... Marc
"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> a ?crit dans le message de news: OEOaCLXsDHA.980@TK2MSFTNGP10.phx.gbl...
> "marc_selles" <marc.selles@nospam-wanadoo.fr> wrote... > [quoted text clipped - 16 lines] > This posting is provided "AS IS" with > no warranties, and confers no rights. Tom Trosborg - 25 Nov 2003 10:04 GMT The synchronization will use the automatically generated number from RepB, and copy these to RepA. That in itself won't create problems.
However, if you have a meaningful number of records you will sooner rather than later run into very real problems: New records added to RepA will turn out to have the same autonumber as new records added to RepB, resulting in conflict error when synchronizing. This is bad enough for the parent records (customers), but potentially very damaging for the child records (orders).
I refer the honourable gentleman to the answer I gave this House a few moments ago (as the say in the British Parliament), regarding generating your own random numbers.
HTH, Tom Trosborg.
> Thanks, Michael > I'll have to 'unscramble' anyway, will do that tomorrow. [quoted text clipped - 37 lines] > > This posting is provided "AS IS" with > > no warranties, and confers no rights. marc_selles - 27 Nov 2003 09:49 GMT Tom,
Thanks for pointing this out : I had not thought of that ! I have finished the 'code merge'(*) and I'm happy I did not encountered this (anyway in my db, the largest table was around 17,000 records, so the odds of a collision was low : since autonumbers range from -2*10^9 to +2*10^9 odds are (17000 / 4*10^9) - or am I wrong ?
(*) to make the merge, one has to create a temp table with tableName, oldAutoNumber, newAutoNumber fields , then insert non-existing records, processing tables in a parent->child->grand-child order, for each table, loop through tableDef, + deal by exception with 'related' autonumber fields, search+insert the right value from temptable
...if anyone is interested in a code skeleton, I can send it, no general code, it needs 'hand tweak' for some tables : for some tables the imported database rules if differences, for others, it's inverse.
forgive my approximative english : when a word is missing, I get back to my latin roots Marc
> The synchronization will use the automatically generated number from RepB, > and copy these to RepA. That in itself won't create problems. [quoted text clipped - 54 lines] > > > This posting is provided "AS IS" with > > > no warranties, and confers no rights. Tom Trosborg - 27 Nov 2003 14:55 GMT Your maths may be perfectly correct (I haven't checked in detail, I'm afraid), but have you taken account of Murphy's Law (if something can go wrong, it will)?
If you like, then please do send me a piece of code, not least because I'm not too sure what you are getting at here. Send it to: tom@oxdyizn.mxe.uyk - leaving out any of the last three letters of the alphabet in that email address (I'm getting paranoid about spammers who trawl these newsgroups) - and I'll be happy to have a look.
Tom Trosborg.
> Tom, > [quoted text clipped - 87 lines] > > > > This posting is provided "AS IS" with > > > > no warranties, and confers no rights.
|
|
|