Home > database >  In PB display data by using OLE controls inventory error BLob file..
In PB display data by using OLE controls inventory error BLob file..

Time:09-23

Saved in the database of large text files, want in the window displays the file contents, you can now read the database files, can save to your local hard disk, want to take advantage of the OLe control does not save the file and display directly, the code is as follows:
String ls_title
Blob ole_blob
String ls_file

Ls_title=this. Object. Id (row)
Setnull (ole_blob)
//this later 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 (can use!

The else
Messagebox (" prompt ", "no file storage")
End the If

In addition, I write the files into the data is to use the empty fileopen (), fileread () because the text is more than 32 k, for written to the database using this way,
To solve the,,,

CodePudding user response:

A, after selectblob see ole_blob length is how many, if not just before the selectblob this will be the sqlca. The autocommit=true
Second, the text is more than 32 k it doesn't matter, with not cycle, speaking, reading and writing
  • Related