Re: Accessing binary field in a Microsoft Access database table



"Stephen Howe" wrote:

Dont worry.
Is the field SHAPE a long integer or not?
You seem to saying that the field is not a long integer, but some other
type.
If so, we need to know the type of the field.

What database are you working with, and what is the field type (in database
terminology not ADO terminology)?

I hope this explains what I want to accomplish, and why I tried the code I
posted before:

long n1 = (long)rec->Fields->GetItem("SHAPE")->Value; // gets the first
item in the field

pvField++; // this increased the value of pvField by 16 bits
pvField++;

I know what these lines of code do, but I dont understand your comment.
This just points you at the next 2 variants.
When you do

pvField++;

it is equivalent to

unsigned char *pc = (unsigned char *)pvField;
pc += sizeof(variant_t);
pvField = (variant_t *)pc;

it is being incremented the size of whatever a variant_t, which is likely to
be a lot more than 16-bits.

long n2 = (long)(*pvField); // I was hoing to get the value of
the next long in the "field!". But I got an exception.

I hope there is way to accomplish what I need to do.

I am sure there is.
But what you want to do, and what the code above does are entirely
different.
Some answer to the type question and database and we may be getting
somewhere

Cheers

Stephen Howe



Stephen,
The database I'm tryng to manipulate is a Microsoft Access database in
Personal GeoDatabase format. This database was designed by a company named
ESRI. One of its tables is called "Highway", and it contains 5 fields:
OBJECTID_1: Autonumber
OBJECTID: Number
HIGHWAY: Text
SHAPE: OLE object
SHAPE_Length: Number (floating point)

The field I described before is "SHAPE", and, as you can see, is an OLE
object which contains the geometric characteristics of a segment of road.
This object was designed by ESRI, and I know the format, because I have the
source code for the VB application that is able to do what I'm trying to
accomplish in C++.

Perhaps this answers your questions better, and I hope you can point my nose
in the right direction.

Thanks,
Miguel Corazao


.



Relevant Pages

  • Re: ADO Recordset open problem IDispatch error #3121
    ... I cannot just rename the old database to another name because ... It is a production live database. ... "Stephen Howe" wrote: ... In Query Analyser execute ...
    (microsoft.public.data.ado)
  • Re: ADO 2.8 Command INSERT INTO with Date Parameter
    ... Here is my irritating problem: ... But which database? ... Dialects of SQL vary. ... Stephen Howe ...
    (microsoft.public.data.ado)
  • Re: ADO and DELETE Statement
    ... What database is this on the backend? ... Stephen Howe ... The DELETE operation is independend from the Navision backend. ...
    (microsoft.public.data.ado)
  • Re: incrementally increase value
    ... >> chooses a response I would like the database to add 1 to the value of the ... Stephen Howe ... Prev by Date: ...
    (microsoft.public.data.ado)
  • Re: OLE Object Issue
    ... the database as OLE objects. ... pictures as files in a directory and just store the PATH to the file in the ... > So I set up an OLE Object field in the table to accomplish this. ... Microsoft Office Access" ...
    (microsoft.public.access.tablesdbdesign)