MFC ADO Access 2000 field containing file contents ?

B

Bill Swartz

Hello,
I need to store and retrieve file contents in an Access 2000 database. I am
using MFC and ADO via COleDispatchDriver. What data type should I use for
the field? How do I get and put the data from MFC?
 
R

rlfine

Bill,

What do you mean by "store and retrieve file contents" ?

ADO implements the COM dual interface-- you can access all of the ADO
methods directly from the vtable - you dont need to use the IDispatch
approach.

You can use ADO and the C++ helper classes from the ADO typelib -- the
#import directive generates the helper/wrapper classes. You wont get any
MFC/Visual Studio wizard support using ADO, but it's still the best
technology available when raw performance is not critical.

here are a couple of links.

http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/
htm/pg_ado_programming_5.asp

regards
roy fine
 
B

Bill Swartz

I just mean that a field in a table must contain the contents of some file.
I know how to do INSERT and SELECT from MFC for field that contain numbers.
How do I INSERT and SELECT for fields that contain file contents? Also, in
Access 2000, when I design the table, what data type do I give the field?
Bill
 
R

rlfine

Bill,

For the column data type in Access/Jet, you have two options - use the
OleObject type or the Memo type. The Memo would work if the contents were
only text - otherwise consider the OleObject type.

To get the data to/from a file into the database for storage only, use the
ADO AppendChunk and GetChunk methods. have a look at KB article Q194975.

Additionally, have a look at the ADO Stream object for easily fetching the
data from a file - and then using the data in an ADO Recordset or Command
object.

regards
roy fine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top