資料庫中保存的大文本檔案,想要在視窗中顯示檔案內容。現在可以把資料庫中檔案讀出來,能保存到本地硬碟上,想利用OLe控制元件不保存檔案而直接顯示,代碼如下:
string ls_title
blob ole_blob
string ls_file
ls_title = this.object.id[row]
setnull(ole_blob)
//this actually loads the ole control from the database into a blob variable
selectblob object into :ole_blob from ole
where id = :ls_title;
If Not IsNull(ole_blob) Then
ole_1.ObjectData=https://bbs.csdn.net/topics/ole_blob
ole_1.activate(offsite!)
else
messagebox("提示框","無檔案存盤")
End If
另外,我把檔案寫進資料空是利用fileopen(),fileread()因為文本大于32K,估采用這樣的方式寫入資料庫。
求解。。。
uj5u.com熱心網友回復:
一、selectblob后看一下ole_blob的長度是多少,如果不對就在selectblob這前將sqlca.autocommit=true二、文本大于32k也沒關系,用回圈讀寫不就可以了
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/68330.html
標籤:控件與界面
上一篇:如何做一個類似于windows cpu使用記錄的程式
下一篇:請問如何寫偽靜態規則
