Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

OpenMailDatabase() - so where is it?

Posted on 2004-04-21
7
Medium Priority
?
729 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 200 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

715 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