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

|
最近因客戶(hù)需要,要用到Sqlite數(shù)據(jù)庫(kù),前端工具使用VB或Access, 在使用過(guò)程中遇到一些問(wèn)題,(特別感謝 席主習(xí)_smileyoufu 幫助)通過(guò)網(wǎng)友幫助和網(wǎng)上搜索,將一些解決心得寫(xiě)下來(lái),希望對(duì)Sqlite入門(mén)者有所幫助和啟動(dòng)
1.VB或Access 要直接使用Sqlite數(shù)據(jù)庫(kù),需要安裝一個(gè)Sqlite litex的版本,才能正常注冊(cè)sqlite3.dll
但實(shí)際我在注冊(cè)中,在一些電腦注冊(cè)會(huì)出現(xiàn)使用問(wèn)題,網(wǎng)友如果測(cè)試成功,請(qǐng)跟貼
sqlite lites使用說(shuō)明及下載地址: http://blog.sina.com.cn/s/blog_48e2ea3401018fiz.html
2.可使用 sqliteforexcel 解決方案,里面封裝了一個(gè)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.)
缺點(diǎn):是沒(méi)有創(chuàng)建新數(shù)據(jù)庫(kù)的方法,使用接口 與ado 不太兼容,語(yǔ)法不相同。遷移成本有點(diǎn)高
3. 第三種解決方案,也是 席主習(xí)_smileyoufu 提供方案,使用vbRichClient5.dll vb_cairo_sqlite.dll DirectCOM.dll
可實(shí)現(xiàn)免注冊(cè)使用sqlite數(shù)據(jù)庫(kù),且因?yàn)?vbRichClient5 的封裝,使用Sqlite數(shù)據(jù)庫(kù)幾乎 沒(méi)有太大的差異。
且Sqlite的數(shù)據(jù)庫(kù)在一些性能性,特別的內(nèi)存數(shù)據(jù)庫(kù),速度非常的快。對(duì)一些單機(jī)軟件非常適合
使用方法,從 http://www.vbrichclient.com/ 官方下載
vbRichClient5.dll vb_cairo_sqlite.dll DirectCOM.dll
即可
唯一缺點(diǎn)是發(fā)布時(shí)需要帶著 vbRichClient5.dll 庫(kù)(注冊(cè)或免注冊(cè)方式)
vb_cairo_sqlite.dll (原生DLL,不需要注冊(cè)) DirectCOM.dll
且 vb_cairo_sqlite.dll vbRichClient5.dll 必須保持在同一個(gè)目錄即可
相關(guān)鏈接:
Access數(shù)據(jù)庫(kù)與Sqlite數(shù)據(jù)庫(kù)性能對(duì)比測(cè)試
http://m.mzhfr.cn/thread-119912-1-1.html
|
評(píng)分
-
查看全部評(píng)分
|