Dopo aver tradotto la Wiki, ho constatato che e' corretta...
Manca solo come connettersi ad un database firebird...
dopo aver scaricato i driver da qui https://firebirdsql.org/en/odbc-driver/ e estratti in una qualsivoglia cartella (possibilmente per ubuntu va messo in /usr/lib/x86_64-linux-gnu/odbc/) si dovra' configurare il file /etc/odbcinst.ini
[FireBird]
Description=Firebird driver ODBC
Driver=/usr/lib/x86_64-linux-gnu/odbc/libOdbcFb.so
Setup=/usr/lib/x86_64-linux-gnu/odbc/libOdbcFb.so
UsageCount=1
CPTimeout=0
CPTimeToLive=0
DisableGetFunctions=0
DontDLCLose=1
ExFetchMapping=1
Threading=3
FakeUnicode=0
Nel file /etc/odbc.ini
[Skema]
Description=FireBird
Driver=FireBird
Dbname=<host server>:<percorso database>
Client=
User=pippo
Password=passfrase
Role=
CharacterSet=WIN1252
ReadOnly=Yes
NoWait=No
Dialect=3
QuotedIdentifier=Yes
SensitiveIdentifier=No
AutoQuotedIdentifier=No
UseSchemaIdentifier=0 - Set null field SCHEMA
LockTimeoutWaitTransactions=0
SafeThread=Yes
per vedere se tutto funziona da terminale si digita:
isql Skema pippo passfrase
Su gambas si setta la connection in questo modo:
DIM oConn As New Connetion
WITH oConn
.Type = "odbc"
.Host = "Skema"
.User = "pippo"
.Password = "passfrase"
.Open()
END WITH
Ho fatto un codice che si collega ad una tabella di firebird in odbc in questo modo:
Public Sub Main()
Dim hRes As Result
Db.Debug = True ' enable debug messages
Try hRes = DbMistral.Exec("SELECT * FROM AABI_BANCHE;")
If Error Then
Print "Error";; Error.Text;; Error.Code
Endif
End
Il programma non va in errore, solo che nel result dove ci sono date ritorna un valore nullo.... Questo sotto e' il debug della funzione sopra:
2021-04-29 18:40:10.750 gb.db.odbc: GetConnectedDBName: desc->name: NULL
2021-04-29 18:40:11.558 gb.db.odbc: SQLGetStmtAttr SQL_ATTR_ROW_NUMBER
2021-04-29 18:40:11.558 gb.db.odbc: 1:2400:0:[unixODBC][Driver Manager]Invalid cursor state
2021-04-29 18:40:11.558 gb.db.odbc: GetRecordCount: First recno=0
2021-04-29 18:40:11.558 gb.db.odbc: GetRecordCount: Last recno=826
2021-04-29 18:40:11.558 gb.db.odbc: GetRecordCount: Record count=827
2021-04-29 18:40:11.558 gb.db.odbc: do_query: create handle 0x563bf4abc5d0
2021-04-29 18:40:11.558 gb.db.odbc: query_init: 0x563bf49c2348 -> 9 columns
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 0x563bf49c2348 (9 columns)
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_PK' -> type = 12
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_X' -> type = 1
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_DMOD' -> type = 93
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_DCRE' -> type = 93
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_UMOD' -> type = 12
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_UCRE' -> type = 12
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_DES1' -> type = 12
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_MNEMONICO' -> type = 12
2021-04-29 18:40:11.558 gb.db.odbc: query_make_result: 'AABI_CIN' -> type = 1
2021-04-29 18:40:11.558 gb.odbc: query_fill: 0x563bf49c2348: 0 (0)
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_PK (12) = 01000
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_X (1) =
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_DMOD (93) =
gb.db.odbc: unable to convert date:
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_DCRE (93) = 2016-09-29 10:50:29
gb.db.odbc: unable to convert date: 2016-09-29 10:50:29
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_UMOD (12) =
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_UCRE (12) = andrea
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_DES1 (12) = BANCA D'ITALIA
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_MNEMONICO (12) =
2021-04-29 18:40:11.558 gb.db.odbc: query_fill: AABI_CIN (1) =
2021-04-29 18:40:11.686 gb.db.odbc: query_release: 0x563bf49c2348: free handle 0x563bf4abc5d0
Dal codice che mi ha fatto cambiare ho commentato la riga 607:
fprintf(stderr, "gb.db.odbc: unable to convert date: %.*s\n", len, data);
Stupidamente avevo fatto copia incolla del codice che mi aveva linkato, ma se andavo a scaricare il file gb.db.odbc/src/main.c quella riga di codice non c'era.
Adesso funziona correttamente
Grazie a tutti
Non ho capito se hanno aggiornato solo i sorgenti o anche i pacchetti della stabile... Dove hai letto la notizia?
Da Gambas-Notification:
Benoît Minisini pushed to branch stable at Gambas / gambas
Commits:
f2004e26
by gambas at 2021-05-02T02:13:39+02:00
Try to read date fields correctly in most ODBC drivers.
[GB.DB.ODBC]
* BUG: Try to read date fields correctly in most ODBC drivers.
ed9ef13a
by gambas at 2021-05-02T02:14:01+02:00
Don't remove file descriptors watches in the 'quit' hook to behave like Qt components.
[GB.GTK]
* BUG: Don't remove file descriptors watches in the 'quit' hook to behave like Qt components.
[GB.GTK3]
* BUG: Don't remove file descriptors watches in the 'quit' hook to behave like Qt components.
4e35ab64
by gambas at 2021-05-02T02:14:09+02:00
Abort JIT compilation before executing the QUIT instruction.
[INTERPRETER]
* BUG: Abort JIT compilation before executing the QUIT instruction.
1326e9eb
by gambas at 2021-05-02T02:14:22+02:00
Use SIGUSR1, now that SIGUSR2 is used by the Gambas debugger.
[GB.WEB.GUI]
* BUG: Use SIGUSR1, now that SIGUSR2 is used by the Gambas debugger.
e487c87c
by Christof Thalhofer at 2021-05-02T02:15:33+02:00
gambas3-selftest comment out Debug symbols
We should need no Debug any more.
dfd02d13
by Christof Thalhofer at 2021-05-02T02:15:42+02:00
gb.test new test suite 'Production'
[GB.TEST]
* NEW: Test suite 'Production' which is called by run.sh.
The test suite 'Production' excludes tests which are not reliable in all
circumstances.
99258f37
by gambas at 2021-05-02T02:15:56+02:00
TerminalView: Reset() method does not fail anymore if the currently running process is dead.
[GB.FORM.TERMINAL]
* BUG: TerminalView: Reset() method does not fail anymore if the currently running process is dead.
f8192e24
by gambas at 2021-05-02T02:16:05+02:00
Fix a string memory leak in error management.
[INTERPRETER]
* BUG: Fix a string memory leak in error management.
656580eb
by gambas at 2021-05-02T02:16:12+02:00
TextEditor: Remove 'tabledragger.js' test file because it is copyrighted..
[GB.FORM.EDITOR]
* BUG: TextEditor: Remove 'tabledragger.js' test file because it is copyrighted.
1f6ac36f
by Benoît Minisini at 2021-05-02T02:16:30+02:00
Update .gitlab-ci.yml file
71fb4919
by gambas at 2021-05-02T02:16:39+02:00
Fix compilation on BSD.
[INTERPRETER]
* BUG: Fix compilation on BSD systems.
[GB.FORM]
* NEW: Search for icon themes in '/usr/local' for BSD systems.
23 changed files:
.gitlab-ci.yml
app/src/gambas3-selftest/.src/TestSources/BaseClass.class
app/src/gambas3-selftest/.src/TestSources/mTest.module
app/src/gambas3-selftest/.src/Tests/GambasSelftests.test
app/src/gambas3-selftest/.src/Tests/SlowThousandsProcs.test
app/src/gambas3-selftest/.src/Tests/Timers.test
app/src/gambas3-selftest/.test
app/src/gambas3-selftest/run.sh
comp/src/gb.form.editor/.component
comp/src/gb.form.editor/.project
− comp/src/gb.form.editor/tabledragger.js
comp/src/gb.form.terminal/.component
comp/src/gb.form.terminal/.project
comp/src/gb.form.terminal/.src/TerminalView/TerminalView.class
comp/src/gb.form/.src/Stock.class
comp/src/gb.web.gui/.src/WebForm.class
gb.db.odbc/src/main.c
gb.gtk/src/main.cpp
gb.gtk3/src/main.cpp
main/gbx/gb_error.c
main/gbx/gbx_c_file.c
main/gbx/gbx_exec.c
main/gbx/gbx_string.c
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. If you'd like to receive fewer emails, you can adjust your notification settings.
Qui il collegamento a gitlab:
https://gitlab.com/gambas/gambas/-/compare/2ba08a82dee6e42a2853fd9369a7cf804ef6c70a...71fb491985531816b9344fad7442ee0ecbc2e80c