@Kadet,
At this point it should be obvious that this is a bug and should be reported as such. The erroneous auto increment value returned does occur using either ODBC or JDBC with Firebird server. This returned value will cause even more problems if there is a subform involved. What you may not have yet encountered is that this not only affects the generated number but also other fields which may default to a value. My testing used a field defaulting to current_timestamp and that value was mangled.
In my testing, this macro attached to the form After record action
event worked as a fix for now:
Sub NewRefresh
Dim oForm As Object
oForm = ThisComponent.getDrawPage().getForms().getByName("MainForm")
If oForm.IsNew Then
oForm.reload()
oForm.moveToInsertRow()
End if
end sub
This only reloads the form (and provides the correct data) and positions on a new record if the record entered is a new record. No further action by the macro if just editing an existing record.
Turns out that my initial problem using ODBC was simply the Advanced setting. It seemed to not work because it turns out, at least in Mint 18.3, that the are a number of other problems.
Here is one in particular you may want to be aware of. This may only be a Linux connector problem.
Mixed tables in a database. This is some with Primary key auto increment and some without. Note table name spelling here.
First situation:
TABLEA - WITH no problem
TABLEB - WITH no problem
Second situation:
TABLEA - WITH no problem
TABLEB - WITHOUT problem - states data is NULL even though entered
Third situation:
BTABLE - WITHOUT no problem
TABLEA - WITH no problem
Only difference between second & third situation is the table name which is how it is sequenced in the DB!
There are certainly many serious problems with ODBC and Firebird server with Linux including crashes if you try to create or edit a table. Many are not present using JDBC.