Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
storing byte[] in access db

 
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum
Author Message
Fahad
Beginner User
Beginner User


Joined: 16 Mar 2004
Posts: 16

Post Post subject: storing byte[] in access db Reply with quote

Hello everyone,
I need to store byte[] data types in my access database. I don't know how I can do it. I like to know what should be the data type of access database that is capable to take byte[] data. I think it might be OLE object.

Then, my second poit is how I can enter byte code into that field i.e. what will be the SQL command. Code of SQL command that stores byte[] to database will be helpful.

Fahad
Wed Apr 14, 04 11:02 pm
Back to top
Fahad View user's profile Send private message Yahoo Messenger
dinangkur
Super Moderator
Super Moderator


Joined: 24 Mar 2004
Posts: 491
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

It seems like you want to store photo, excel or word, sound or other types of binary data. If you want to bind a object to OLE field you've to add a control in program to handle. e.g. if you want to add a picture then you've to add a control in your application to handle pics and store method. In access we do it from Insert menu->object. Add the OLE object to empty field.
When it comes to query it's same. SELECT, UPDATE, DELETE.
Look at northwind database in your access. That will clear you everything. By the way, search google. And I got a feeling that you don't bother to do that. Check the link bellow-it explains everything with source code.

http://www.experts-exchange.com/Databases/MS_Access/Q_20790048.html

Happy Hacking.

-DK.

p.s. did you ever think about VB MySQL. Far better than access and very much professional. Visit: http://www.vbmysql.com

You will love it.
_________________
...we too are stardust...
Sat Apr 24, 04 12:35 am
Back to top
dinangkur View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Pavel
Beginner User
Beginner User


Joined: 07 May 2004
Posts: 11

Post Post subject: Reply with quote

Hi I also need to know the solution. Can anyone write the sql command to do this, for me? I have done this in Java as-
try
{
PreparedStatement ps = db.con.prepareStatement("update tblRealStateCompanies set ra_com_logo=? where ra_com_no='"+tfComNo.getText()+"'");
ps.setBinaryStream(1,new FileInputStream(logo),(int)logo.length());

ps.execute();
ps.close();
}catch(SQLException sqle){}
catch(FileNotFoundException fnfe){}

Can't I do this with update command? If I can, then how?

--------
pavel
Fri May 07, 04 11:09 am
Back to top
Pavel View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group