Solved

OpenMailDatabase() - so where is it?

Posted on 2004-04-21
7
704 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

751 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