Open form function problem
Posted: Mon Apr 07, 2008 7:58 pm
Hello,
I'm using the following function to open a specified form in a database (borrowed from http://user.services.openoffice.org/en/ ... =20&t=2326):
But here is the problem that really baffles me. When I add a new record or made changes to an existing one using the opened form, all changes are gone as soon I close OpenOffice.org. I have absolutely no idea why this happens.
Kind regards,
Dmitri
I'm using the following function to open a specified form in a database (borrowed from http://user.services.openoffice.org/en/ ... =20&t=2326):
Code: Select all
Function OpenForm (FormName As String) as Object
Dim Context As Object
Dim DB As Object
Dim Conn As Object
Dim FormDoc As Object
Dim Form AS Object
Dim Args(1) As New com.sun.star.beans.PropertyValue
Context=CreateUnoService("com.sun.star.sdb.DatabaseContext")
DB=Context.getByName("WriterDB")
Database=DB.getConnection("","")
Args(0).Name="ActiveConnection"
Args(0).Value=Database
Args(1).Name="OpenMode"
Args(1).Value="open"
FormDoc=DB.DatabaseDocument.FormDocuments.loadComponentFromURL (FormName,"_blank",0,Args() )
End Function
Kind regards,
Dmitri