delphi 6 + sqlite3 |
答題得分者是:t27
|
jonathan
一般會員 發表:6 回覆:7 積分:7 註冊:2002-03-28 發送簡訊給我 |
|
aftcast
站務副站長 發表:81 回覆:1485 積分:1763 註冊:2002-11-21 發送簡訊給我 |
------
蕭沖 --All ideas are worthless unless implemented-- C++ Builder Delphi Taiwan G+ 社群 http://bit.ly/cbtaiwan |
rick060
高階會員 發表:2 回覆:112 積分:217 註冊:2009-11-17 發送簡訊給我 |
有沒有考慮自己直接玩弄 API ?
unit Utility_sqlite3; interface type sqlite3_stmt = Pointer; Psqlite3_stmt = PPointer; sqlite3 = Pointer; Psqlite3 = PPointer; sqlite3_destructor_type = Pointer; const SQLITE_OK = 0 ;// Successful result // beginning-of-error-codes SQLITE_ERROR = 1 ;// SQL error or missing database SQLITE_INTERNAL = 2 ;// Internal logic error in SQLite SQLITE_PERM = 3 ;// Access permission denied SQLITE_ABORT = 4 ;// Callback routine requested an abort SQLITE_BUSY = 5 ;// The database file is locked SQLITE_LOCKED = 6 ;// A table in the database is locked SQLITE_NOMEM = 7 ;// A malloc() failed SQLITE_READONLY = 8 ;// Attempt to write a readonly database SQLITE_INTERRUPT = 9 ;// Operation terminated by sqlite3_interrupt() SQLITE_IOERR = 10 ;// Some kind of disk I/O error occurred SQLITE_CORRUPT = 11 ;// The database disk image is malformed SQLITE_NOTFOUND = 12 ;// Unknown opcode in sqlite3_file_control() SQLITE_FULL = 13 ;// Insertion failed because database is full SQLITE_CANTOPEN = 14 ;// Unable to open the database file SQLITE_PROTOCOL = 15 ;// Database lock protocol error SQLITE_EMPTY = 16 ;// Database is empty SQLITE_SCHEMA = 17 ;// The database schema changed SQLITE_TOOBIG = 18 ;// String or BLOB exceeds size limit SQLITE_CONSTRAINT = 19 ;// Abort due to constraint violation SQLITE_MISMATCH = 20 ;// Data type mismatch SQLITE_MISUSE = 21 ;// Library used incorrectly SQLITE_NOLFS = 22 ;// Uses OS features not supported on host SQLITE_AUTH = 23 ;// Authorization denied SQLITE_FORMAT = 24 ;// Auxiliary database format error SQLITE_RANGE = 25 ;// 2nd parameter to sqlite3_bind out of range SQLITE_NOTADB = 26 ;// File opened that is not a database file SQLITE_ROW = 100 ;// sqlite3_step() has another row ready SQLITE_DONE = 101 ;// sqlite3_step() has finished executing SQLITE_STATIC = 0; SQLITE_TRANSIENT = -1; //basic Function function sqlite3_open(const filename : PAnsiChar ; ppDb : Psqlite3) : Integer; stdcall ; external 'sqlite3'; function sqlite3_close(pDb : sqlite3): Integer; stdcall ; external 'sqlite3'; function sqlite3_step( pStmt : sqlite3_stmt): Integer; stdcall ; external 'sqlite3'; function sqlite3_exec( pDb : sqlite3 ; const sql : PAnsiChar ; pCallBack : Cardinal ; pParam : Pointer ; errmsg : PPAnsiChar): Integer; stdcall ; external 'sqlite3'; function sqlite3_errcode(pDb : sqlite3): Integer; stdcall ; external 'sqlite3'; function sqlite3_errmsg(pDb : sqlite3): PAnsiChar ; stdcall ; external 'sqlite3'; function sqlite3_finalize(pStmt : sqlite3_stmt): Integer; stdcall ; external 'sqlite3'; function sqlite3_prepare(pDb : sqlite3;const zSql : PAnsiChar; nByte : Integer ; ppStmt : Psqlite3_stmt ; pzTail : PPAnsiChar): Integer; stdcall ; external 'sqlite3'; procedure sqlite3_free( ptr : Pointer); stdcall ; external 'sqlite3'; //Binding Function function sqlite3_bind_int(pStmt : sqlite3_stmt; nParamIndex : Integer; nValue : Integer): Integer; stdcall ; external 'sqlite3'; function sqlite3_bind_int64(pStmt : sqlite3_stmt; nParamIndex : Integer; nValue : Int64): Integer; stdcall ; external 'sqlite3'; function sqlite3_bind_double(pStmt : sqlite3_stmt; nParamIndex : Integer; dlValue : Double): Integer; stdcall ; external 'sqlite3'; function sqlite3_bind_null(pStmt : sqlite3_stmt; nParamIndex : Integer): Integer; stdcall ; external 'sqlite3'; function sqlite3_bind_zeroblob(pStmt : sqlite3_stmt; nParamIndex : Integer; nValue : Integer): Integer; stdcall ; external 'sqlite3'; function sqlite3_bind_text(pStmt : sqlite3_stmt; nParamIndex : Integer; const szValue : PAnsiChar; nLength : Integer; destructorType : Integer): Integer; stdcall ; external 'sqlite3'; function sqlite3_bind_text16(pStmt : sqlite3_stmt; nParamIndex : Integer; const szValue : PAnsiChar; nLength : Integer; destructorType : Cardinal): Integer; stdcall ; external 'sqlite3'; function sqlite3_bind_blob(pStmt : sqlite3_stmt; nParamIndex : Integer; const pBuffer : Pointer ; nLength : Integer; destructorType : Cardinal): Integer; stdcall ; external 'sqlite3'; //Fetch Function function sqlite3_column_blob(pStmt : sqlite3_stmt; iCol : Integer) : Pointer ; stdcall ; external 'sqlite3'; function sqlite3_column_bytes(pStmt : sqlite3_stmt; iCol : Integer): Integer ; stdcall ; external 'sqlite3'; function sqlite3_column_bytes16(pStmt : sqlite3_stmt; iCol : Integer): Integer ; stdcall ; external 'sqlite3'; function sqlite3_column_double(pStmt : sqlite3_stmt; iCol : Integer) : Double; stdcall ; external 'sqlite3'; function sqlite3_column_int(pStmt : sqlite3_stmt; iCol : Integer): Integer ; stdcall ; external 'sqlite3'; function sqlite3_column_int64(pStmt : sqlite3_stmt; iCol : Integer): Int64 ; stdcall ; external 'sqlite3'; function sqlite3_column_text(pStmt : sqlite3_stmt; iCol : Integer):PAnsiChar; stdcall ; external 'sqlite3'; function sqlite3_column_text16(pStmt : sqlite3_stmt; iCol : Integer):pointer; stdcall ; external 'sqlite3'; function sqlite3_column_type(pStmt : sqlite3_stmt; iCol : Integer): Integer ; stdcall ; external 'sqlite3'; // SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); //sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);; implementation end. |
aftcast
站務副站長 發表:81 回覆:1485 積分:1763 註冊:2002-11-21 發送簡訊給我 |
|
GrandRURU
站務副站長 發表:240 回覆:1680 積分:1874 註冊:2005-06-21 發送簡訊給我 |
|
t27
中階會員 發表:34 回覆:95 積分:90 註冊:2002-06-19 發送簡訊給我 |
|
GrandRURU
站務副站長 發表:240 回覆:1680 積分:1874 註冊:2005-06-21 發送簡訊給我 |
|
t27
中階會員 發表:34 回覆:95 積分:90 註冊:2002-06-19 發送簡訊給我 |
|
jonathan
一般會員 發表:6 回覆:7 積分:7 註冊:2002-03-28 發送簡訊給我 |
謝謝 , 我現使用 http://source.online.free.fr/ 中下載元件測試 ,
目前正在測試中 經我測試 , table 若有中文資料 , 則 SqlitePassDatabase1 fields的值會呈現空白 TsqlPassdataSet元件屬性 database/options/encoding 我只能選擇 UTF8 , 初步元件測試結果如下: 1. 若我事項先透過 sqliteadmin 產生Table,再編輯Table的中文資料 , 再透過 d6 TsqlPassdataSet 呈現, 則 TsqlPassdataSet 所呈現的中文資料會空白, 2.若使用 D6 TsqlPassdataSet元件編輯 Table的中文資料 ,若再透過 sqliteadmin 工具查看 , 則中文資料會呈現亂碼 因此我猜測應該與 TsqlPassdataSet元件的 encording 有關 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |