Re: Accessing binary field in a Microsoft Access database table
- From: MCorazao3 <MCorazao3@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Aug 2007 13:54:03 -0700
"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
.
- References:
- Re: Accessing binary field in a Microsoft Access database table
- From: Stephen Howe
- Re: Accessing binary field in a Microsoft Access database table
- From: Stephen Howe
- Re: Accessing binary field in a Microsoft Access database table
- From: MCorazao3
- Re: Accessing binary field in a Microsoft Access database table
- From: Stephen Howe
- Re: Accessing binary field in a Microsoft Access database table
- Prev by Date: Re: connection string format
- Next by Date: ExecuteComplete does not fire with adAsyncExecute?
- Previous by thread: Re: Accessing binary field in a Microsoft Access database table
- Next by thread: ExecuteComplete does not fire with adAsyncExecute?
- Index(es):
Relevant Pages
|
|