Drew Jensen escribió:
OK - not what I wanted, but something worth noting:

This change will allow you to open an existing query, in a query design window using the active connection.

Sub Test( aQueryName as string, aConnection as variant )

   oDesktop = createUnoService("com.sun.star.frame.Desktop")
         Dim aURL as New com.sun.star.util.URL
   aURL.Complete = ".component:DB/QueryDesign"
      oDispatchObject = oDesktop.queryDispatch(_
                       aURL, _
                       "_BLANK",_
                       com.sun.star.frame.FrameSearchFlag.CREATE)
      Dim aProps(2) as New com.sun.star.beans.PropertyValue
   aProps(0).Name = "ActiveConnection"
   aProps(0).Value = aConnection      aProps(1).Name = "QueryDesignView"
   aProps(1).Value = TRUE
   aProps(2).Name  = "CurrentQuery"
   aProps(2).Value = aQueryName
      oDispatchObject.dispatch(aURL, aProps)

End Sub

Now to get the FormGridView to load up with the data from a query and I'm done!!!

A search for ".component:DB/FormGridView" in http://lxr.go-oo.org gives us 4 file founds http://lxr.go-oo.org/search?filestring=&string=%22.component%3ADB%2FFormGridView%22

One (http://lxr.go-oo.org/source/dba/dbaccess/source/ui/browser/exsrcbrw.cxx#333) shows us that we may be in the right direction using a dispatch object.

What is sure, is that internally they use other things (as the search returns only 4 files).

It would be nice to search what they do to open the query designer for editing a SQL command in a form control (this is a new feature).


Any way, we've gone far (just to see the glass half-full adn not half-empty).

Something that may be should be tried: looking at file:///opt/openoffice.org2.3_sdk/docs/common/ref/com/sun/star/sdb/QueryDesign.html it says that the XFrame reference "is mandatory".

*********************************
    * Frame
has to be an ::com::sun::star::frame::XFrame interface specifying the frame to plug the QueryDesign component into.
      This parameter is mandatory.
*****************************************************************

What if you add an XFrame reference to the properties.
For you not to create a new frame, and attach it to a new window, etc., load a new empty Writer document, get the frame and pass this (and change the search flags); although AFAIK in theory what we are doing provides already a frame (a brand-new frame name and com.sun.star.frame.FrameSearchFlag.CREATE tells "create a new frame")


Goodnight [1:18 AM in Argentina, so I'm going to bed] and luck!

Ariel.

--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.

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

Reply via email to