473,320 Members | 2,048 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,320 software developers and data experts.

Long Binary Data v OLE Object

Dear all,

I want to store some data in form of a zip file into an access
database.
I created a table with with a column of type OLE Object, then I
designed a form to insert data to the table.
I inserted some files to it, but when I tried to read them using my
java client it retrieves an OLE object but I just need the file
content (what the program gets form the db was the original file added
with some extra binary information at the beginning and the end of the
file)

I wrote a program for inserting and retrieving a file in java, and it
works perfect, but when I insert a file using the access form I cannot
read it using my java client.

The additional information which may helps is that when I insert a
file using ms access form in the table, it is shown as 'Package' in
the table data sheet and when I insert it using java that is 'Long
binary data'.

How can I design a ms access form to insert files in long binary data
format?

Here is my code fragment which read the database:
--------------------------------------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. PreparedStatement st = connection.prepareStatement ("select * from
  2. MyTable");
  3. st.execute();
  4. ResultSet rs = st.getResultSet();
  5. while (rs.next()) {
  6.  int id = rs.getInt("id");
  7.  JdbcOdbcInputStream is =
  8. (JdbcOdbcInputStream)rs.getBinaryStream("webcontent");
  9.  byte[] webcontent = is.readData();
  10.  new File("file.zip").delete();
  11.  OutputStream os = new FileOutputStream("file.zip");
  12.  os.write(webcontent);
  13.  os.close();
  14.  break;
  15. }
--------------------------------------------------------------------------------------------------------------------

Thanks in advance,
--

Mohammad Moghimi
May 2 '07 #1
0 4039

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

Similar topics

0
by: Sean | last post by:
I'm new to using long raw fields with ASP. I know it would be easier to leave the files on the file system, but the client wants them in the database. Based on what I've read so far, I have used...
0
by: bart plessers | last post by:
Hello, For a while I am working with ThumbsPlus ( http://www.cerious.com/ ) as manager for pics. The benefit of the program is that it stores all kind of information in a central Microsoft...
1
by: bart plessers | last post by:
Hello, For a while I am working with ThumbsPlus ( http://www.cerious.com/ ) as manager for pics. The benefit of the program is that it stores all kind of information in a central Microsoft...
3
by: Randy | last post by:
I have heard that access 2003 has functions for dealing with Long Binary Data. Does anyone know if this is true? Background: I am using 2000 with a table linked to a SQL server. One of the fields...
8
by: Jerry | last post by:
I have an off-the-shelf app that uses an Access database as its backend. One of the tables contains a field with an "OLE Object" datatype. I'm writing some reports against this database, and I...
26
by: Patient Guy | last post by:
Has anyone written code that successfully manipulates binary file data using Javascript? It might---and in the case of doing I/O, will---make use of browser- specific functions (ActiveX/COM with...
15
by: Jacques | last post by:
Hi I am an dotNet newby, so pardon my ignorance. I am looking for a method of saving/copying a managed class to a stream/file WITHOUT saving the object's state, eg. if I have a ref class with...
0
by: Chris3000 | last post by:
Hi everyone How can I embeded an image to OLE Object field using Long Binary data. and what Long Binary data means and how to use it. does anyone have any ideas on I would to display...
21
by: Bart C | last post by:
I've always had a problem knowing exactly how wide my integer variables were in C, and the little program below has increased my confusion. Run on 3 compilers on the same cpu (32-bit pentium),...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.