473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to export out the OLE object content to a folder (c:\temp)

chinfk
15
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.
Dec 5 '07 #1
4 11734
FishVal
2,653 Expert 2GB
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
Dec 12 '07 #2
chinfk
15
Hi Brother Fish,

Thanks for your advice, did this feature available in MS access ?
Dec 13 '07 #3
FishVal
2,653 Expert 2GB
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
    Expand|Select|Wrap|Line Numbers
    1. Dim stmFileStream As New ADODB.Stream
    2. Dim RS As New ADODB.Recordset
    3. ............... 
    4. With stmFileStream
    5.     .Open
    6.     .Type = adTypeBinary
    7.     .LoadFromFile "X:\FileToStoreInTable.ext"
    8.     RS![oleBLOB] = stmFileStream.Read
    9.     RS.Update
    10.     .Close
    11. End With
    12. .........
    13. Set stmFileStream = Nothing
    14. Set RS = Nothing
    15.  
  • to save BLOB to disk file
    Expand|Select|Wrap|Line Numbers
    1. Dim stmFileStream As New ADODB.Stream
    2. Dim RS As New ADODB.Recordset
    3. .......
    4. With stmFileStream
    5.      .Open
    6.      .Type = adTypeBinary
    7.      .Write RS![oleBLOB]
    8.      .SaveToFile "X:\FileName.ext"
    9.      .Close
    10. End With
    11. .........
    12. Set RS = Nothing
    13. Set stmFileStream = Nothing
    14.  

Regards,
Fish
Dec 14 '07 #4
What did you use to format your source so well?

Thanks, Hans
Apr 3 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
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...
0
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!...
8
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...
2
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,...
1
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...
0
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...
3
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?
1
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...
0
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...
0
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.