Re: [api-dev] How to open a database form

2005-02-15 Thread Ian Laurenson
On Wed, 2005-02-16 at 14:28, Ian Laurenson wrote:
 On 2005-02-12, Frank Schönheit - Sun Microsystems, Inc. wrote:
  Andrew Pitonyak wrote:
   How can I load a Base document,
  com.sun.star.sdb.DatabaseContext.loadComponentFromURL( ... )
 [remainder snipped]
 
 My apologies for being thick but I can only get the form displayed but
 not in a way that it actually functions as a form (code below). 
I was being thick - this seems to work:

sub subDisplayForm(sDatabaseName as string, sFormName as string)
dim mArgs(1) as new com.sun.star.beans.PropertyValue

oDatabase = fnGetOpenDatabase(sdatabaseName)
oConnection = oDatabase.getConnection(,)
mArgs(0).name = OpenMode
mArgs(0).value = open 'openDesign
mArgs(1).name = ActiveConnection
mArgs(1).value = oConnection
oForm = oDatabase.getFormDocuments.getByName(sFormName)
'oForm.visibilityChanged(true)
oForm = oDatabase.getFormDocuments.loadComponentFromURL(sFormName,
_blank, 0, mArgs())
end sub


Thanks, Ian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to open a database form

2005-02-15 Thread Frank Schönheit - Sun Microsystems, Inc.
Hi Ian,

 Also, is there any way of having basic code be part of the .odb file?

No, unfortunately there isn't, and won't be for 2.0. OOo internally
features two application frameworks, an old one and a new
(UNO-based) one. For new applications (like Base), the latter is
recommended, but unfortunately it still lacks some features - like
embedding Basic scripts ... :(

 I can add a macro library to a form but it doesn't appear to get
 saved (1.9.77 for Linux).

This issue should be fixed in one of the next developer snapshots.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems, Inc.   http://www.sun.com -
- OpenOffice.org Database Accesshttp://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]