To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=106007
                 Issue #|106007
                 Summary|"No connection" exception when opening form via macro
               Component|Database access
                 Version|OOo 3.1.1
                Platform|PC
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|none
             Assigned to|dbaneedsconfirm
             Reported by|schaber





------- Additional comments from scha...@openoffice.org Sun Oct 18 17:27:19 
+0000 2009 -------
I am trying to open a form from a macro in the same database. The connection is
not registered, because it should work just by opening the database file from
any location.

When I do the following I get a Basic runtime error of type SQLException. The
message says "[OOoBase] No connection to the database exists". 

  oDBSource = ThisComponent.DataSource
  oConn = oDBSource.getConnection( "" , "" )
  form = ThisComponent.getFormDocuments().getByName("MyForm").open()
  oConn.close()

It happens when the form view is active after opening the database file. It does
not happen when the tables view is active, or when I manually open any form or
table first. After that I can open any form via macro. 

It also does not work when doing this:

  Dim aProp(1) As New com.sun.star.beans.PropertyValue
  aProp(0).Name = "ActiveConnection"
  aProp(0).Value = ThisComponent.CurrentController.ActiveConnection
  aProp(1).Name = "OpenMode"
  aProp(1).Value = "open"
  OpenForm = ThisComponent.getFormDocuments().loadComponentFromURL("MyForm", "",
0, aProp()) 

In this case the report opens without any error, but it has not connection to
the database. So the form is empty.

Any workaround for this?

Thanks.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@dba.openoffice.org
For additional commands, e-mail: issues-h...@dba.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to