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). 

Also, is there any way of having basic code be part of the .odb file? I
can add a macro library to a form but it doesn't appear to get saved
(1.9.77 for Linux).

Any help greatly appreciated.

Here is my code:

sub subDisplayForm(sDatabaseName as string, sFormName as string)
oDatabase = fnGetOpenDatabase(sdatabaseName)
oDatabase.getFormDocuments.loadComponentFromURL(sFormName,"_blank", 0,
array())
'oDatabase.getFormDocuments.getByName(sFormName)
end sub


function fnGetOpenDatabase(sDatabaseName as string)
oEnum = StarDesktop.getComponents.createEnumeration
while oEnum.hasMoreElements
  oPosDB = oEnum.nextElement
  if oPosDB.implementationName = _
   "com.sun.star.comp.dba.ODatabaseSource" then
    if right(oPosDB.name, len(sDatabaseName)) = sDatabaseName then
      fnGetOpenDatabase = oPosDB
      exit function
    end if
  end if
wend
end function

Thanks, Ian


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

Reply via email to