Using SQL I know how to update each field with an arbitrary WHERE clause:
Code: Select all
UPDATE "Catalogue" SET "last sold" = CURRENT_DATE WHERE "stat" = 999;
UPDATE "Catalogue" SET "stat" = ("stat"+'^') WHERE "stat" = 999;
UPDATE "Catalogue" SET "sold" = ("sold" + 1) WHERE "stat" = 999;This is what I have so far:
Code: Select all
Sub updatesale
Dim oStatement
Dim oStatement2
Dim oStatement3
Dim oStatement4
oStatement = ThisComponent.DrawPage.Forms.getByIndex(0).ActiveConnection.createStatement()
oStatement.executeUpdate( "UPDATE CURRENT RECORD SET ""last sold"" = CURRENT_DATE WHERE ""stat"" = 999" )
oStatement2 = ThisComponent.DrawPage.Forms.getByIndex(0).ActiveConnection.createStatement()
oStatement2.executeUpdate( "UPDATE CURRENT_RECORD SET "sold" = ("sold" + 1) WHERE ""stat"" = 999" )
oStatement3 = ThisComponent.DrawPage.Forms.getByIndex(0).ActiveConnection.createStatement()
oStatement3.executeUpdate( "UPDATE CURRENT_RECORD SET "stat" = ("stat"+'^') WHERE ""stat"" = 999" )
End SubSo, first, what's going wrong, and second, how can I change my WHERE clause to refer to only one record at a time?
If anyone can help me with this I will really appreciate it!