Windows XP
Firebird 2.5.4
Firebird ODBC 2.0.3
Active Tcl 8.6.4.1
目前如果要使用 Firebird,TDBC 沒有提供相關的 driver,但是因為 Firebird 有 ODBC driver 而 TDBC-ODBC 已經有提供了,所以測試一下目前 TDBC-ODBC via Firebird ODBC 的狀況。
ODBC DSN 設定如下:
然後使用下列的方式測試:
package require tdbc::odbc
set connStr "DSN=Firebird DSN; UID=danilo; PWD=danilo;"
tdbc::odbc::connection create db $connStr
set statement [db prepare {create table person (id integer, name varchar(40))}]
$statement execute
$statement close
set statement [db prepare {insert into person values(1, 'leo')}]
$statement execute
$statement close
set statement [db prepare {insert into person values(2, 'yui')}]
$statement execute
$statement close
set statement [db prepare {SELECT * FROM person}]
$statement foreach row {
puts [dict get $row ID]
puts [dict get $row NAME]
}
$statement close
db close
然後再測試刪除 table:
package require tdbc::odbc
set connStr "DSN=Firebird DSN; UID=danilo; PWD=danilo;"
tdbc::odbc::connection create db $connStr
set statement [db prepare {drop table person}]
$statement execute
$statement close
db close
看起來是正確工作的。
沒有留言:
張貼留言