Solved

OpenMailDatabase() - so where is it?

Posted on 2004-04-21
7
685 Views
Last Modified: 2013-12-18
I just started playing with the ole/com classes in 6.5.  Why can't I open
the mail database?  Don't be shy - point out the obvious :-)

ole error message is

OpenMail: BEGIN_OLE_MESSAGE
Win32::OLE(0.1603) error 0x80020003: "Member not found"
    in METHOD/PROPERTYGET ""
END_OLE_MESSAGE

The session open fine with my local lotus application running.  
(Any links to java,perl get mail messages appreciated.)
Thanks

# Lotus open mail - 101

# open a session/server
my $Notes = Win32::OLE->new('Notes.NotesSession')
  or die "Cannot start Lotus Notes Session object.\n";

my ($Version) = ($Notes->{NotesVersion} =~ /\s*(.*\S)\s*$/);
print qq/The current user is $Notes->{UserName}.\n/;
print qq/Running Notes "$Version" on "$Notes->{Platform}".\n/;

# get NotesDBDirectory (so I can open mail via com)
my $dir = $Notes->GetDbDirectory("");

$oleMsg = Win32::OLE->LastError();
if ($oleMsg) {
     print qq(GetDB: BEGIN_OLE_MESSAGE\n$oleMsg\nEND_OLE_MESSAGE));
}

# get the mail database -  noteDatabase
my $m = $dir->OpenMailDatabase();
$oleMsg = Win32::OLE->LastError();
if ($oleMsg) {
       print qq(OpenMail: BEGIN_OLE_MESSAGE\n$oleMsg\nEND_OLE_MESSAGE));
}
0
Comment
Question by:hank1
7 Comments
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
I have moved this question to the Lotus Notes/Domino TA for you.

CRAK
Page Editor
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
I believe that your lotus notes registry entry are not complete.. A re-install should fix this kind of problems.

~Hemanth
0
 
LVL 1

Author Comment

by:hank1
Comment Utility
Ok, give it a reinstall Thursday.  The it guys did just "complete" an upgrade of some
kind.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:hank1
Comment Utility
What a @#$@ morning!  Ok, we've reinstalled everything.  Still same problem.
What would a Lotus Jones do next? Thanks

(Complete client installed and designer - administrator not installed.)
Here the printout again

The current user is CN=hank1/OU=TMC/OU=AM/O=RAYP Inc.
Running Notes "Release 6.5|September 26, 2003" on "Windows/32".

 Error msg: t.pl 1.0x 4/20
      file: t.pl
      line: 30
    system: ole message
       msg: Failed to obtain mail.
BEGIN_OLE_MESSAGE
Win32::OLE(0.1603) error 0x80020003: "Member not found"
    in METHOD/PROPERTYGET ""
END_OLE_MESSAGE

CODE ---------------------------


use strict;
use Win32::OLE qw( in );

my $rev = '1.0x';
my $oleMsg = '';

my $Notes = Win32::OLE->new('Notes.NotesSession')
  or die "Cannot start Lotus Notes Session object.\n";

my ($Version) = ($Notes->{NotesVersion} =~ /\s*(.*\S)\s*$/);
print qq/The current user is $Notes->{UserName}.\n/;

print qq/Running Notes "$Version" on "$Notes->{Platform}".\n/;

# NotesDatabase class
my $dir = $Notes->GetDbDirectory("");

$oleMsg = Win32::OLE->LastError();
if ($oleMsg) {
   erMsg($0, $rev, __FILE__, __LINE__, 'ole message',
     qq(Failed to obtain db.\n) .
     qq(BEGIN_OLE_MESSAGE\n$oleMsg\nEND_OLE_MESSAGE));
}

my $m = $dir->OpenMailDatabase();
$oleMsg = Win32::OLE->LastError();
if ($oleMsg) {
   erMsg($0, $rev, __FILE__, __LINE__, 'ole message',
     qq(Failed to obtain mail.\n) .
     qq(BEGIN_OLE_MESSAGE\n$oleMsg\nEND_OLE_MESSAGE));
}

# -------------------------------------------------------------------------
sub
erMsg {
  my ($prg, $rev, $file, $line, $type, $msg) = @_;
  my $d = '4/20';
  print STDERR "\n";
  print STDERR " Error msg: $prg $rev $d\n";
  print STDERR "      file: $file \n";
  print STDERR "      line: $line \n";
  print STDERR "    system: $type\n";;
  print STDERR "       msg: $msg\n";
}

0
 
LVL 1

Author Comment

by:hank1
Comment Utility
OK, I can't open the mail database for some reason (can't do it on anyone
elses box either, so I  sessions.GetDatabase(....), then read the Views
attribute.  Here's a list of what I got.  Is the mail database in here?
And if it is, how does one open it?

------code
my $db = $Notes->GetDatabase('', 'names.nsf');
my $v = $db->{'Views'};
foreach my $vn ( in $v) {
  my $name = $vn->{'Name'};
  print qq/Name is $name\n/;
}


------------- output  (Test each for 'IsFolder', is only one.)
Name is _Advanced\Connections
Name is Contacts
Name is Groups
Name is _Advanced\Certificates
Name is _Advanced\Locations
Name is By Category
Name is ($CompanyList)
Name is _Advanced\Accounts
Name is ($Accounts)
Name is _Advanced\International MIME Settings
Name is ($InternationalMIMESettings)
Name is ($ByCategory)
Name is Temporary Export Certificates
Name is ($Adminp)
Name is ($Certifiers)
Name is ($Connections)
Name is ($CrossCertByName)
Name is ($CrossCertByRoot)
Name is ($Groups)
Name is ($Locations)
Name is ($MailGroups)
Name is ($PeopleGroupsByLang)
Name is ($PeopleGroupsCorpHier)
Name is ($PeopleGroupsFlat)
Name is ($PeopleGroupsHier)
Name is ($People)
Name is ($ServerAccess)
Name is ($Users)
Name is ($VIMGroups)
Name is ($VIMPeopleAndGroups)
Name is ($VIMPeopleByLastName)
Name is ($VIMPeople)
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 50 total points
Comment Utility
OpenMailDatabase.. finds the correct db for the logged in user and opens it for script. You are looking at the list of views here from names.nsf
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
On the same installation, see if you can write a little VB program that does the equivalent, and see if that works.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now