我希望我的应用程序可以选择打开电子邮件&标签的日历。 我添加了这个我发现的代码:
try {
var db:NotesDatabase = session.getDbDirectory("D:/IBM/Notes/Data/").openMailDatabase();
var dc:NotesDocumentCollection = db.getAllDocuments();
requestScope.status = "Mail database " + db.getTitle() + " is " +
(db.getSize()/1024).toFixed() + "KB long and has " + dc.getCount() + " documents";
} catch(e) {
requestScope.status = "Error opening mail database\n" + e.toString();
}
似乎出现了问题。
谢谢,
林
答案 0 :(得分:1)
getDbDirectory()
方法需要服务器名称作为参数(而不是绝对路径)。所以试试这个:
try {
var db:NotesDatabase = session.getDbDirectory("servername/organization").openMailDatabase();
var dc:NotesDocumentCollection = db.getAllDocuments();
requestScope.status = "Mail database " + db.getTitle() + " is " +
(db.getSize()/1024).toFixed() + "KB long and has " + dc.getCount() + " documents";
} catch(e) {
requestScope.status = "Error opening mail database\n" + e.toString();
}