Connecttoserver error

As far as I can see, this log shows that the Contacts database opened and connected just fine. You ran the procedure twice, right? Did the connection work? The log is only going to be of any value if it shows what happens when the connection failed.

I don’t immediately see how this could happen, but I’m wondering if the active database is actually Contacts when you use the info(“serverconnection”) function. If it was some other database, it would return false. You could use dbinfo( instead, and/or check to make sure that the Contacts database is the active database.

It doesn’t have anything to do with this issue, but why are you using forcesynchronize? This is not intended to be used in a routine manner like this, it should only be used if there is some reason to think that synchronization has failed. You have designed this code on the assumption that normal synchronization will never work, is that really what you want to do? Early beta versions of Panorama X Server did sometimes have sync problems, but I haven’t heard of anything like that for a couple of years.

You started out by saying that sometimes the file fails to connect. How did you originally come to that conclusion?

I’m guessing that perhaps the procedure you have posted here is only part of the actual procedure you are using? Does this procedure go ahead and perform further operations with the Contacts database?

Hugo Alvarez has reported a problem with “stray clicks” on other windows while a shared database is being opened. Could this be what is happening in your case?