問題描述
我正在使用 VBscript、ADO 和 SQLite ODBC 驅(qū)動(dòng)程序來存儲(chǔ)和檢索大字符串 (~5KB).存儲(chǔ)它們工作正常,也許是因?yàn)槲夷軌蛟诮壎?insert 語句的參數(shù)時(shí)指定大小.然而,當(dāng)我嘗試檢索這些字符串時(shí),我正確地獲得了前 256 個(gè)(或 255 個(gè))字符,但其余接縫來自隨機(jī)內(nèi)存區(qū)域.我做錯(cuò)了什么(除了使用 VBscript 和 ADO...)?
I am using VBscript, ADO and the SQLite ODBC driver to store and retrieve large strings (~5KB). Storing them works fine, maybe because I am able to specify a size while I bind the parameters of the insert statement. When I try to retrieve those strings, however, I correctly get the first 256 (or 255) characters but the rest seams to come from a random memory area. What am I doing wrong (besides using VBscript and ADO...)?
我愿意將文本存儲(chǔ)為二進(jìn)制數(shù)據(jù).但是我嘗試過的功能(稍后檢索它)不起作用.
I'm open to the idea of storing the text as binary data. But the functions I tried, to retrieve it later, didn't work.
推薦答案
getChunk 不適用于 msdn 上指出的記錄字段,字段屬性 adFldLong 還說明是否可以在該字段上使用 getChunk.在某些字段中,您必須使用 SQL 查詢來檢索數(shù)據(jù)的長度,而不是使用屬性 actualSize
getChunk will not work on a record field as noted on msdn, also the field attribute adFldLong states if getChunk can be used on that field. In some fields you must use the SQL query to retrieve the length of data instead of using attribute actualSize
這里有一個(gè)很好的例子 http://kek.ksu.ru/eos/ecommerce/masteringasp/18-06.html
there is a good example e here http://kek.ksu.ru/eos/ecommerce/masteringasp/18-06.html
這篇關(guān)于使用 ADO 和 VBScript 在 SQLite 中存儲(chǔ)和檢索大字符串的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!