Re: Accessing binary field in a Microsoft Access database table
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Thu, 9 Aug 2007 21:07:20 +0100
I made a terrible mistake by using the word "record" where I shoud have
used
"field". Please accept my appology. My problem is retrieving a lot of
bynary
data from a single field (called "SHAPE" in this case). Actually, I have a
Visual Basic application that writes the contents of this field on a disk
file simply by specifying the object that contains this field. Apparently
VB
knows how to get the length of the field. The program then reads the data
in
the field from the disk file in a sequential fashion. Unfortunately the
field
contains counters that define how much data is stored in it. So I don't
know
the length of the field ahead of time.
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
.
- Follow-Ups:
- 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
- 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
- Prev by Date: Re: Accessing binary field in a Microsoft Access database table
- Next by Date: Re: Accessing binary field in a Microsoft Access database table
- Previous by thread: Re: Accessing binary field in a Microsoft Access database table
- Next by thread: Re: Accessing binary field in a Microsoft Access database table
- Index(es):
Relevant Pages
|
|