Configuration settings for server either missing or invalid

I have created a replica of an IMAP Online account database, programmatically, using CreateReplica()

The database appears to create OK, but when I try to open it in Notes I get the error “configuration settings for server either missing or invalid”.

If I use domino designer the database will open and I can see some of the database properties, but if I click on forms or agents (or anything else) I get the same error: configuration settings for server either missing or invalid.

Does anyone have any idea what server it is looking for and where in the database I need to configure it? I am using the Notes client standalone without a domino server.

Note: this all works fine if I create the IMAP replica by hand, it only fails if I try to create the replica programmatically, which suggests my location configuration must be OK?

Cheers,

Anne.