Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-04-2005, 07:52 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default Use FFish store/retrieve Binay File with Access 2003?

In my working project, I've large numeber of JPG,Flv.... I'd like store them in Access 2003, is it possible do that with FFish?
any idea?
thank in advance;

code is more appreciative
Reply With Quote
  #2 (permalink)  
Old 11-05-2005, 12:47 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:Use FFish store/retrieve Binay File with Access 2003?

hey! is anybody there?

I've checked ADO's ref. I can use GetChunk/AppendChunk to do Binary data I/O on Access 2000 OLE fields

is that's true for Access2003?
Reply With Quote
  #3 (permalink)  
Old 11-05-2005, 01:48 PM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:Use FFish store/retrieve Binay File with Access 2003?

I've tried use ADO stream object, but it's seem not work!

code as follow:
.......
var rs = new ActiveXObject("ADODB.Recordset");

var sm = new ActiveXObject("ADODB.Stream");

sm.Mode = 3;//adModeReadWrite 1:read only ....
sm.Type = 1;//adTypeBinary 2:text
sm.Open;
sm.LoadFromFile("c:\\8.jpg");

sm.SaveToFile ("c:\\8a.jpg",2);
// work properly

rs.Open("select * from news", conn, 1, 2);
rs.MoveFirst();
//
trace("read....");
rs.Fields(5).Value = sm.Read(-1);
// Fields(5) is an OLE field

trace("update....");
rs.Update;


rs.Close;

rs = new ActiveXObject("ADODB.Recordset");
rs.Open("select * from news", conn, 1, 2);
rs.MoveFirst();

sm.Write(rs.Fields(5).Value);// err occur!


sm.SaveToFile ("c:\\8a.jpg",2);
rs.Close;

..................................


any idea?
Reply With Quote
  #4 (permalink)  
Old 11-05-2005, 02:07 PM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:Use FFish store/retrieve Binay File with Access 2003?

oh,GOD!
it's works, err resulted from mistake! Fields(4) is OLE, Field(5) is memo!

I've checked 8.jpg&8a.jpg with Acdsee!
show's the same picture!

strange things is that
8.jpg is 29K
8a.jpg is 57k

almost double sized!
I'v tested other jpgs, almost same case!

Who can tell me why?

Reply With Quote
  #5 (permalink)  
Old 11-05-2005, 02:34 PM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:Use FFish store/retrieve Binay File with Access 2003?

Odds!
I change code:
from:
sm.Write(rs.Fields(4));
to:
sm.Write(rs.Fields("Photo"));

finally got right file in right size!

but in preview mode I got an ADO stream warning message!

I woooooonder whyyyyyyyyyyyyyy????
Reply With Quote
  #6 (permalink)  
Old 11-08-2005, 08:14 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Use FFish store/retrieve Binay File with Access 2003?

Sorry we've never tried this. If you want to pass binary data, please try the StringStream object.


e.g.

var s = StringStream.readFromFile(name) ;
field.appendChunk(s);

var ss = field.GetChunk(Size); // ss is a stringstream object

Reply With Quote
  #7 (permalink)  
Old 11-08-2005, 05:19 PM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:Use FFish store/retrieve Binay File with Access 2003?

I'm sorry for mistake again!
I've solved it! thanks anyway

the mistake is that
i've fogotten clear ADO.stream ! so it's buffered twice!
just add sm.close and add a sm.open !

I'm very sorry!
regards!
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:03 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.