ODBC - Access - OLE Object Field

ODBC - Access - OLE Object Field

Post by Bernard Alleysso » Sun, 29 Mar 1998 04:00:00



Access 97 - VC5.0 - NT4SP3 - ODBC

I've got an access database, and try to instanciate an object stored in an
ole object field.
(to fill the field, I use the access command Insert | Object...)

I found that the data stored in the field is some header followed by the
real object
(header includes classname and so on, so Its good for me)

This header (OBJECTHEADER) is mentionned nowhere except in  MS KB Article
Q147727 (16aug1996, Access 2.0),
wich seem to be quite outdated

Does anyone know about this header ?
Is it officially documented and available from one header file somewhere ?
(I couldn't find it)

Bernard Alleysson

 
 
 

ODBC - Access - OLE Object Field

Post by Brian Marte » Tue, 31 Mar 1998 04:00:00



>Does anyone know about this header ?
>Is it officially documented and available from one header file somewhere ?
>(I couldn't find it)

I don't believe it is documented anywhere. I have a sample program from MS
that is no longer available that lists the header structure as follows.

////////////////////////////////////////////////////////////////////////////
/
// struct OLEOBJHDR: defined how ACCESS stores OLE objects

typedef struct _oleobjhdr
{
 WORD typ;    // Type signature (Always 'OC' == 0x1c15)
 WORD cbHdr;    // Size of header
 union {
  OLE_OBJTYPE oot; // OLE Object type code (OT_LINK, OT_EMBEDDED, OT_STATIC)
  LONG lobjTyp;  // in our case: OT_EMBEDDED
 };
 WORD cchName;   // Count of characters in object name
 WORD cchClass;   // Count of characters in class name
 WORD ibName;   // Offset of object name in stream
 WORD ibClass;   // Offset of class name in stream
 POINTS ptSize;   // Original size of object --- NOTE:
       // ptSize was not being used for its intended purpose,
       // so for Access 2.0 and later, these should be set
       // ptSize.x = ptSize.y = -1.  Access uses this to
       // determine what version saved the object to the
       // database (Access <= 1.1 uses positive values).

Quote:} OLEOBJHDR;

typedef OLEOBJHDR* POLEOBJHDR;

If you want more information or a copy of the sample just email me.

 
 
 

1. Insertion of OLE-Object into OLE-Field of Access-Table

Hi!

This question is probably not new, but I haven't found any clues here
and elsewhere, so I hope you can help me!

I have an Access (Jet)-Database with text an graphics, to display the
graphics I am using an OLE-container connected to a data-control. For
the purpose of editing the database one should be able to use the
OLE-object (i.e. insertion, etc.).  To get things complicated I am
using another approach for the rest of the data, because the
data-control is too limited for my purposes. I am not using this other
approach for the OLE-Object, because I don't know how to view the
graphic-data from the database, and this is also true for the other
direction:

How do I get a new or changed OLE-Object into my database? I have read
something about getchunk/appendchunk but I can't really see how this
helps me, and I don't want to use a SQL-database, if this should solve
my problem.

Thank you very much for any information!

2. Problems with Analysis Manager

3. Linking or Embedding an OLE Object in an Access OLE DataType Field using DAO

4. Error 511

5. Accessing an Access OLE Object Field

6. Why can't I have more than one hStmt open at the same time?

7. VB30: Accessing OLE-field in ACCESS-DB via OLE-VBX

8. Menu popups...without DEFINE BAR

9. Adding objects to Access OLE/LongBinary fields

10. Retrieve OLE Object field (Picture) from Access

11. Inserting an OLE object into an OLE field!!!!

12. Access OLE Object Field in VB 5.0