Apache OpenOffice (AOO) Bugzilla – Issue 61896
Issue:61869, HSQL access and update via Makro
Last modified: 2013-02-24 21:07:43 UTC
This issue based on Issue 61869 - I don´t know the correct contact person/ programmer): Using a makro to access and update HSQL databases produces an error. Here is the macro code (P.S. please see below the comments of marc): Sub ResetTMP Dim DatabaseContext as Object Dim s as string Dim oDatenquelle as Object Dim oHandler as Object Dim oDatVerb as Object Dim oStatement as Object Dim oErgSet as Object Dim sSQL as String DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext") oDatenquelle = DatabaseContext.getByName("Adress_db") If not oDatenquelle.IsPasswordRequired Then oDatVerb = oDatenquelle.getConnection("","") else oHandler = oDatenquelle.createUnoService("com.sun.star.sdb.InteractionHandler") oDatVerb = oDatenquelle.ConnectWithCompletion(oHandler) end if oStatement = oDatVerb.createStatement() oStatement.ResultSetConcurrency = com.sun.star.sdbc.ResultSetConcurrency.UPDATABLE oStatement.ResultSetType = com.sun.star.sdbc.ResultSetType.SCROLL_SENSITIVE sSQL ="SELECT ""TMP1"", ""TMP2"", ""TMP3"" FROM ""TMP""" oErgSet = oStatement.executeQuery(sSQL) oErgSet.absolute(1) REM die folgenden 3 Zeilen ändern den Inhalt der 1.-3. Spalte des Ergebnisses der Abfrage "sSQL" oErgSet.updateString(1, "text1") 'here you get the error oErgSet.updateString(2, "text2") oErgSet.updateString(3, "text3") oErgSet.updateRow() End sub The error: Basic runtime error ...exception.... Type: com.sun.star.sdbc.SQLException Message: Function Sequence error. Using other databases (like MS-Access)the update function with the macro will run. best regards - Jörg Leistikow - ------- Additional comments from msc Fri Feb 10 00:51:41 -0800 2006 ------- Hi, I can reproduce this, reassign it to the right developer and set target. Bye Marc
so, what's the difference? why a new issue?
sw->oj: looks like one for you
See http://www.oooforum.org/forum/viewtopic.phtml?t=32812 for another code example and further diagnostic details.
The hsqldb sources doesn't allow at the moment other concurrency then read_only. As workaround you could use a com.sun.star.sdb.RowSet to update your table. The RowSet uses INSERT and UPDATE statements to achieve the task.