Hi Guys,
I have OLE field in the tables, in the datasheet view, it is written there as "packager". Usually, I insert the field content by insert object ways ( insert a PDF ).
How should I export all the files / object to a particular folder in C:\Temp ?
Thanks in advancevd.
4 11734
Hi, chinfk.
It seems that there is no way to do it via code as long as Packager object doesn't support automation.
What do you think about storing the files in BLOBs ? It may be an efficient solution in a case you are storing read-only files.
Regards,
Fish
Hi Brother Fish,
Thanks for your advice, did this feature available in MS access ?
Hi Brother Fish,
Thanks for your advice, did this feature available in MS access ?
Oh, ye. It is available.
BLOB may be stored in OLE type table field. In table view you will see "Long binary data" in non-empty field. Access does not have native mechanism to save BLOB to table but with some code it could be easily achieved via Recordset object.
There are at least two methods to manipulate BLOB in a table field. - using GetChunk / AppendChunk methods available both in DAO and ADO
- using ADODB.Stream object ("Microsoft Activex Data Objects" version at least 2.5 has to be referenced - open Tools > References, uncheck currently referenced ADO library if its version is lower, check reference to the latest version, e.g. in Access2003 ADO 2.8 is available)
The second method is simpler and faster.
The following examples assumes that ADODB.Recordset is already opened and its cursor is on an appropriate record. Field storing BLOB has name [oleBLOB]. - to save file contents to a table as BLOB
-
Dim stmFileStream As New ADODB.Stream
-
Dim RS As New ADODB.Recordset
-
...............
-
With stmFileStream
-
.Open
-
.Type = adTypeBinary
-
.LoadFromFile "X:\FileToStoreInTable.ext"
-
RS![oleBLOB] = stmFileStream.Read
-
RS.Update
-
.Close
-
End With
-
.........
-
Set stmFileStream = Nothing
-
Set RS = Nothing
-
- to save BLOB to disk file
-
Dim stmFileStream As New ADODB.Stream
-
Dim RS As New ADODB.Recordset
-
.......
-
With stmFileStream
-
.Open
-
.Type = adTypeBinary
-
.Write RS![oleBLOB]
-
.SaveToFile "X:\FileName.ext"
-
.Close
-
End With
-
.........
-
Set RS = Nothing
-
Set stmFileStream = Nothing
-
Regards,
Fish
What did you use to format your source so well?
Thanks, Hans
Sign in to post your reply or Sign up for a free account.
Similar topics
by: ls |
last post by:
Hi All,
I looking for help with ZODB data export to text file. I have file
Data.fs (file becomes from Plone CMS) and I have to display content
structure, data like intro, body of article, etc...
|
by: PengYu.UT |
last post by:
Hi,
There is something wrong with the line labeled "//error". I want D's
memeber _a point to a "C" object if it is constructed from another "D"
object. Do you have any idea how to do it? Thanks!...
|
by: Ksou |
last post by:
I would like to ask how can I submit a dom object content (e.g. xml content)
from client side to server by using javascript.
Or is there any method that I can invoke at dom object to obtain its...
|
by: Champika Nirosh |
last post by:
Hi All,
I am developing a Content Repository to store some html pages (htmls have
some embadded resources such as images)
I keep all the html files and their resources away form the wwwroot,...
|
by: Jako |
last post by:
Hi guys...
Well once again I'm in a dilemma. Currently I have a RTF2 object in
Access that is linked to a memo field in a table, the reason for this
is so that I can have bullets and numbers in...
|
by: Vincent |
last post by:
Dear all,
I have implemented a class to export the content of RichTextBox to
image in WYSISYG mode so that line breaks on the screen are the same as
exported.
C# Code:
public struct...
|
by: zaiena |
last post by:
hi
i'm using ole object in my forms to loaded word document and i wanna to print them can i do that??and how?
|
by: Sin Jeong-hun |
last post by:
I need to add some files that are required only during the setup
process. For example, I need to store the banner image for the
installer. But, there's no such Special Folder like "Temp" in the sub...
|
by: =?Utf-8?B?U2hhbQ==?= |
last post by:
Hai all,
In my application, I need to Export webpage things into hard drive. I am
using gridview, and i export all things(with the help of some sites) into
excel except images.
Please, Can...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |