Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Close the database with LotusScript

846 views
Skip to first unread message

Banny

unread,
May 11, 1998, 3:00:00 AM5/11/98
to

Hello everyone,

In a form of my database design, I want to perform a button to save the
form and then immediately close the form window and the database.
I then write the script below:

Dim uiWorkspace As New NotesUIWorkspace
Dim uiDoc As NotesUIDocument
Set uiDoc = uiWorkspace.CurrentDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase

Call uiDoc.Close
Call db.Close

After I run the form, I have the following error messages:

Cannot close the context database

Why ?

Thanks!

Zapl

unread,
May 11, 1998, 3:00:00 AM5/11/98
to

Close is not a method of NotesDatabase class.
You can use @Command([FileSave]) and @Command([FileCloseWindow])
to do this.


Kendall P. Bullen

unread,
May 11, 1998, 3:00:00 AM5/11/98
to

In article <01bd7ced$4cb585e0$ab6e4cca@fail-home->, "Zapl" <f...@hehe.com> wrote:

>Close is not a method of NotesDatabase class.
>You can use @Command([FileSave]) and @Command([FileCloseWindow])
>to do this.

Within LotusScript?

--
Kendall P. Bullen Web: http://www.his.com/~kendall/
E-mail: kendall@-->^^^^^^^

ABESDRIS Nicolas

unread,
May 18, 1998, 3:00:00 AM5/18/98
to

[Quoted from Kendall P. Bullen (see-m...@his.com)]

> >Close is not a method of NotesDatabase class.
> >You can use @Command([FileSave]) and @Command([FileCloseWindow])
> >to do this.
>
> Within LotusScript?

Why do you want this to be Lotus Script based ?
The formula language is excellent in simple, easy situations,
and this is one of them.

A simple

@If (@Command ([FileSave]) ; @Command ([FileCloseWindow]); "")

will work perfectly.
Good luck,

Nicolas Abesdris / CLS / Vortex

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Nicolas Abesdris has a bachelor of computer science from University
of Montreal, and is a Certified Lotus Specialist Developer II with
three years of experience. For information about Vortex Consulting
send email to: vor...@montreal.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Kendall P. Bullen

unread,
May 18, 1998, 3:00:00 AM5/18/98
to

In article <w8Q71.5998$av.17...@carnaval.risq.qc.ca>,
vor...@montreal.net wrote:

>> Within LotusScript?
>
> Why do you want this to be Lotus Script based ?

I asked about LotusScript because we have a need to do it from LotusScript
(which isn't possible).

> The formula language is excellent in simple, easy situations,
> and this is one of them.

That's all well and good, but amazingly enough, some things can't be done
in formula language for various reasons. . . .

KPB

0 new messages