Ich möchte per Makro Daten in eine Datenbank "Verwaltung" schreiben. Und da speziell in die Tabelle "Einnahmen".
Das Makro schaut so aus:
Code: Alles auswählen
Sub Kontoabgleich
Dim oDatabaseContext as Object
Dim oDataSource as object
dim oConnection as object
dim ostatement as object
dim oResult as object
oDatabasecontext=CreateUnoService("Com.sun.star.sdb.oDatabaseContext")
oDataSource=oDatabaseContext.getbyName("Verwaltung")
oConnection=oDataSoure.getConnection(",")
ostatement=oConnection.createstatement()
oStatementResultSetConcurrency=com.sun.star.odbc.resultsetConcurrency.updatable
oResultset=ostatementexecuteQuery("Select* FROM Einnahmen")
oResultset.moveToINsertRow()
Oresultset.updateString(2, "Miete incl. NK")
Oresultset.updateInt(3,525)
Oresultset.updateString(3, "Miete incl. NK")
Oresultset.updateInt(4,2)
Oresultset.updateInt(5,1)
End Sub
oDataSource=oDatabaseContext.getbyName("Verwaltung") immer den Fehler "Variable nicht belegt".
Aber es gibt die Datenbank.
Hat jemand eine Lösung??
Schon jetzt danek..
Grüße
Uli