Detecting replica status 
Author Message
 Detecting replica status

Hello,

I asked this in the microsoft.public.access.replication, but got no
answer there, perhaps someone here knows the answer.

I'm trying to solve a "simple" problem. In VBA module code, I want to be

able to detect if a database is a simple database, a replica or a design

master.
I hoped this would be some kind of property of the database object, but
couldn't find it. I tried foloing code but this doesn't seem to work
either (for every kind of db I get Master!):

If (db.ReplicaID = db.DesignMasterID) Then
  MsgBox "Master"
Else
  MsgBox "No Master"
End If

Can someone please give me an indication of how to do this?

Thanks,
Tom



Fri, 11 Mar 2005 16:02:18 GMT  
 Detecting replica status
Three minutes of experimentation in the debug window (Access97) shows that a
non-replicated db returns a null string ("") for the values of DesignMasterID
and ReplicaID.  If your db is not replicated then DesignMasterId is a Null
string so:

  If db.DesignMasterId = vbNullString then
    Msgbox "Unreplicated"
  ElseIf Db.DesignMasterId = db.ReplicaId then
    MsgBox "Replication Master"
  Elseif Db.DesignMasterID <> Db.ReplicaID then
    MsgBox "Replicated Database (slave)"
  Else
    MsgBox "I don't know. What do you think?"
  End If

Quote:

> Hello,

> I asked this in the microsoft.public.access.replication, but got no
> answer there, perhaps someone here knows the answer.

> I'm trying to solve a "simple" problem. In VBA module code, I want to be

> able to detect if a database is a simple database, a replica or a design

> master.
> I hoped this would be some kind of property of the database object, but
> couldn't find it. I tried foloing code but this doesn't seem to work
> either (for every kind of db I get Master!):

> If (db.ReplicaID = db.DesignMasterID) Then
>   MsgBox "Master"
> Else
>   MsgBox "No Master"
> End If

> Can someone please give me an indication of how to do this?

> Thanks,
> Tom



Fri, 11 Mar 2005 19:23:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Detecting dial-up networking connection status

2. Detecting a buttons status

3. Detecting Browser Status Bar Text?

4. how to detect printer status in VB

5. How to detect printer status through vb

6. Detecting Docking Station Status

7. How do I detect drag drop operation status, without drag_over or drag_drop events

8. Detecting the status of other windows

9. Detecting Service status on NT with VB4

10. Detecting Modem Status in VB

11. Detecting key status for shift, ctrl and alt

12. Checking Carrier Detect Status on Modem

 

 
Powered by phpBB® Forum Software