469,590 Members | 2,464 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,590 developers. It's quick & easy.

Long Binary Data v OLE Object

Dear all,

I want to store some data in form of a zip file into an access
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

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

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 3659

Post your reply

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

Similar topics

3 posts views Thread by Randy | last post: by
26 posts views Thread by Patient Guy | last post: by
15 posts views Thread by Jacques | last post: by
21 posts views Thread by Bart C | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.