技術(shù) 點
- 技術(shù)
- 點
- V幣
- 點
- 積分
- 144710

|
最近因客戶需要,要用到Sqlite數(shù)據(jù)庫,前端工具使用VB或Access, 在使用過程中遇到一些問題,(特別感謝 席主習_smileyoufu 幫助)通過網(wǎng)友幫助和網(wǎng)上搜索,將一些解決心得寫下來,希望對Sqlite入門者有所幫助和啟動
1.VB或Access 要直接使用Sqlite數(shù)據(jù)庫,需要安裝一個Sqlite litex的版本,才能正常注冊sqlite3.dll
但實際我在注冊中,在一些電腦注冊會出現(xiàn)使用問題,網(wǎng)友如果測試成功,請跟貼
sqlite lites使用說明及下載地址: http://blog.sina.com.cn/s/blog_48e2ea3401018fiz.html
2.可使用 sqliteforexcel 解決方案,里面封裝了一個dll ,下載地址: http://sqliteforexcel.codeplex.com/
SQLite3_StdCall.dll
SQLiteForExcel.xls
SQLiteForExcel_64.xlsm
SQLiteForWord.doc
里面也包含
- SQLite3_StdCall is a small and very simple C .dll that makes it possible to use the standard SQLite3 .dll from VBA. It just passes calls from VBA on to SQLite without any change in the parameters, but this allows the StdCall calling convention that VB6 and VBA is limited to.
- Sqlite3.bas VBA module has all the VBA Declares, and does the parameter and string conversions. It exposes a number of SQLite3xxxx functions. These map as directly as possible to the SQLite C API, with no change in the semantics. Although I have not exposed the whole API, most of the core interface is included, in particular the prepared statement, binding, retrieval and backup functions. Date values are stored as Julian day real numbers in the database.
- Sqlite3Demo.bas VBA module has tests that serve as nice examples of how to use the SQLite3xxxx functions.
- SQLite3Demo.xls contains the two VBA modules.
- 64-bit support for use with the 64-bit versions of Excel can be found in SQLiteForExcel_64.xlsm which has VBA code that supports both 32-bit and 64-bit versions of Excel. A 64-bit build of SQLite 3.7.13 is located in x64\SQLite3.dll. The corresponding Sqlite3Demo_64.bas module shows how to target both 32-bit and 64-bit Excel with the same VBA code (some #Ifs are required). (Note that the default install of Office is always the 32-bit version, even on a 64-bit version of Windows. Only if the 64-bit version of Office has been specifically selected will the 64-bit modules be required.)
缺點:是沒有創(chuàng)建新數(shù)據(jù)庫的方法,使用接口 與ado 不太兼容,語法不相同。遷移成本有點高
3. 第三種解決方案,也是 席主習_smileyoufu 提供方案,使用vbRichClient5.dll vb_cairo_sqlite.dll DirectCOM.dll
可實現(xiàn)免注冊使用sqlite數(shù)據(jù)庫,且因為 vbRichClient5 的封裝,使用Sqlite數(shù)據(jù)庫幾乎 沒有太大的差異。
且Sqlite的數(shù)據(jù)庫在一些性能性,特別的內(nèi)存數(shù)據(jù)庫,速度非常的快。對一些單機軟件非常適合
使用方法,從 http://www.vbrichclient.com/ 官方下載
vbRichClient5.dll vb_cairo_sqlite.dll DirectCOM.dll
即可
唯一缺點是發(fā)布時需要帶著 vbRichClient5.dll 庫(注冊或免注冊方式)
vb_cairo_sqlite.dll (原生DLL,不需要注冊) DirectCOM.dll
且 vb_cairo_sqlite.dll vbRichClient5.dll 必須保持在同一個目錄即可
相關(guān)鏈接:
Access數(shù)據(jù)庫與Sqlite數(shù)據(jù)庫性能對比測試
http://m.mzhfr.cn/thread-119912-1-1.html
|
評分
-
查看全部評分
|