Solved

OpenMailDatabase() - so where is it?

Posted on 2004-04-21
7
690 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
ID: 10881543
I have moved this question to the Lotus Notes/Domino TA for you.

CRAK
Page Editor
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10881947
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
ID: 10884427
Ok, give it a reinstall Thursday.  The it guys did just "complete" an upgrade of some
kind.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 1

Author Comment

by:hank1
ID: 10892052
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
ID: 10902855
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
ID: 10904472
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
ID: 10923382
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 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

11 Experts available now in Live!

Get 1:1 Help Now