Link to home
Start Free TrialLog in
Avatar of hank1
hank1

asked on

OpenMailDatabase() - so where is it?

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));
}
Avatar of CRAK
CRAK
Flag of Netherlands image

I have moved this question to the Lotus Notes/Domino TA for you.

CRAK
Page Editor
Avatar of HemanthaKumar
HemanthaKumar

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

~Hemanth
Avatar of hank1

ASKER

Ok, give it a reinstall Thursday.  The it guys did just "complete" an upgrade of some
kind.
Avatar of hank1

ASKER

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";
}

Avatar of hank1

ASKER

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)
ASKER CERTIFIED SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
On the same installation, see if you can write a little VB program that does the equivalent, and see if that works.