Error: database has not been open yet

Hi,

here i have 100 documents, in each document i have the information group name and database name.

my requirement is i have to give the access level for each group for that database

here i am writting the code to open the database

Set db1 = New NotesDatabase( sernam, dbpat )

here the sernam and dbpat i am getting the servername and dbpat

If Not db1.IsOpen Then

Call db1.Open ( sernam, dbpat)

					End If

it is giving the error database not open yet.

i have access to all the databases.

if i open the database manually and run the code then it is working

please let me know how i can solve this, this became a critical issue for me, please give valubale suggestion if any body knows it. thanks in advance.

Subject: Error: database has not been open yet

Try to use

If Not db1.IsOpen Then

Call db1.OpenByReplicaID( sernam, repid)

End If

That’s the way we solve the problem and it is working fine.