本帖最后由 happytc 于 2011-7-19 02:14 编辑
难道不是简单地:
#include <SQLite.au3>
Local $hImage, $fData, $hFileName, $sData, $hImageQuery, $hImageRow
_SQLite_Startup (@ScriptDir & "\sqlite3.dll")
_SQLite_Open(@ScriptDir & "\image.db")
_SQLite_Exec(-1,"CREATE TABLE IF NOT EXISTS Test (data blob);")
$hImage = FileOpen(@ScriptDir & "\LiveCapture.ico", 16)
$fData = FileRead($hImage)
$sData = _SQLite_Encode($fData)
MsgBox(0, 0, $fData)
_SQLite_Exec(-1,"INSERT INTO Test VALUES (" & $sData & ");")
_SQLite_Query(-1,"SELECT data FROM Test WHERE rowid=1;", $hImageQuery)
_SQLite_FetchData($hImageQuery, $hImageRow, 1)
MsgBox(0, 0, Hex($hImageRow[0]))
_SQLite_QueryFinalize ($hImageQuery)
$hFileName = FileOpen(@ScriptDir & "\imageDB.gif", 2)
FileWrite($hFileName, $hImageRow[0])
_SQLite_Close()
_SQLite_Shutdown()
|