Hallo zusammen,

ich hab mal wieder ein kleines Problem, bei dem ich nicht weiter komme.

Ich möchte in meinem Makro unten dem erstellten UnoService RowSet ein
Command übergeben, dass mit Platzhaltern ausgestattet ist, die ich
vorher befülle. Geht das überhaupt? Oder geht nur der Weg, der im
Handbuch S. 431 für das Arbeiten mit Platzhaltern beschrieben ist?

Sub SubKat1_loeschen

REM Verbindung zum Formular
    oForm =
thisComponent.drawpage.forms.getByName("frm_Kategorie").getByName("frm_Subkategorie1")
    oConnection = oForm.activeConnection()

    stDataSourceName = ThisDatabaseDocument.Title
    stDataSourceName = Left(stDataSourceName, len(stDataSourceName)-4)

    iRow = oForm.getByName("tabCtrl_SubKat1").RowSet.getRow

    otxtField =
oForm.parent.getByName("tabCtrl_Kategorie").getByName("txtField_KatID")
    iEintrag = otxtField.getCurrentValue()

REM SQL-Befehl vorbereiten
    stSQLRowSet = "SELECT * FROM ""tab_Sub_Kat_1"" WHERE
""Sub_Kat_Fremd_ID"" = ?"
    oSQLRowSet = oConnection.prepareStatement(stSQLRowSet)
    oSQLRowSet.setInt(1, iEintrag)

REM RowSet-Objekt erstellen
    oRowSet = createUnoService("com.sun.star.sdbc.RowSet")
    with oRowSet
        .DataSourceName = stDataSourceName
        .Command = stSQLRowSet
        .ResultSetConcurrency =
com.sun.star.sdbc.ResultSetConcurrency.UPDATABLE
        .ResultSetType = com.sun.star.sdbc.ResultSetType.SCROLL_SENSITIVE
        .execute()
    End With

REM Löschen der Zeile
    oRowSet.absolute(iRow)
    oRowSet.deleteRow

oForm.reload
End Sub

Viele Grüße und frohe Weihnachten euch allen!

Stefan Deutsch


--
Liste abmelden mit E-Mail an: users+unsubscr...@de.libreoffice.org
Probleme? 
https://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: https://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: https://listarchives.libreoffice.org/de/users/
Datenschutzerklärung: https://www.documentfoundation.org/privacy

Antwort per Email an