Hi
I am using this piece of code(below) to loop through a folder with mailfiles. With some mailfile I will receive at the last line ( the code where the replica id is taken) the message that the database has not been open yet. The MailDB object is created in lotusscript but probably not open yet. The message is not showing for all files. How can I prevent that this message is showing? How come that I don´t get this message for all files? I am using an ID that has access to all mailfiles.
Set mailDb = s.GetDatabase ( personmailfileserver , personmailfilepath )
If mailDb Is Nothing Then
Goto volgende
End If
mailrepid = mailDb.ReplicaID
Regards
Subject: Error message when opening databases through lotusscript
I’ve found it’s good to use as a check to see if you actually got a DB before trying to use it.
if trim(db.tile)!=“” then
end if
Subject: RE: Error message when opening databases through lotusscript
Hi
This will not work. Because when db does not exist or not open he will come with the same error message (“Database has not been open yet”).
Regards
Subject: RE: Error message when opening databases through lotusscript
Check your inputs. Put in an error trap (see “On error” statement) that prints the values of the variables you are passing to the GetDatabase function. Is there really such a database? What happens if you try to open it manually using those exact values for server and filepath?
There actually is a reason you are getting the error. The database is not there or you don’t have access to open it for some reason. If you check the IsOpen property of the database, you can avoid getting the error, but what you do instead is really up to you and your application.
Subject: RE: Error message when opening databases through lotusscript
Hi
Thank you for responding.
I have a question. You said that the database is maybe not there. But if that was the case then it should go in the if statement and go to the next mailfile. So does that automatically means that the ID that is used does not has access to the mailfile? Can a id that does not has access to the mailfile still get a handle to the db object through GetDatabase method?
Regards
Subject: RE: Error message when opening databases through lotusscript
You will find the answer to your question, if you read the manual pages for the functions you are using. Failing that, it takes about two minutes to test this for yourself.
Subject: RE: Error message when opening databases through lotusscript
Hi
You are right. I just red the design help.
Excuse me for the time I waste for you 