Edited:
.
.
AtribuiCategoria(oForm As Object)
Dim vResult As Long ' Return value
Dim oResultAs As Object ' com.sun.star.sdbc.XResultSet
Dim oQuery As Object ' com.sun.star.ucb.XContent
Dim oStatement As Object
Dim xStatement As Object ' com.sun.star.sdbc.XStatement
xStatement = CreateUnoService("com.sun.star.sdbc.XStatement")
Context = CreateUnoService("com.sun.star.sdbc.DatabaseContext")
oResult = CreateUnoService("com.sun.star.XResultSet")
oQuery = CreateUnoService("com.sun.star.XContent")
Dim sSql As String ' SQL statement
Dim bDirect ' Alias of DirectSQL
Dim tbDespesasCC As String
Dim tbCategoria As String
Dim fldCategoria As String
Dim fldIDCategoria As String
tbDespesasCC = "Despesas Conta Corrente"
tbCategoria = "Categoria"
fldCategoria = "Categoria"
fldIDCategoria = "ID Categoria"
' Execute command
sSQL = "UPDATE tbDespesasCC SET Categoria = fldIDCategoria.Categoria"
VResult = ExecuteSQL(sSql)
REM oStatement = con.prepareStatement(sSql)
REM Set oResult = _ExecuteSql(sSql, bDirect)
REM If IsNull(oResult) Then GoTo Finally
END SUB