Re: Accessing binary field in a Microsoft Access database table



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


.



Relevant Pages

  • What is happening to my email??
    ... There are many ways to impersonate email addresses. ... It was probably pulled from a database that collects info ... Dont worry about it, but if you really want to track them ... >those porn-type emails. ...
    (microsoft.public.security)
  • Re: Very basic help request
    ... My recommendation would be "don't." ... use the many tools to summarize and/or ... > I have a database that has 6 columns and 2000 rows. ... > Can someone give me a pointer as to the method, or the terminology that I ...
    (microsoft.public.excel.newusers)
  • Re: Restore Fail
    ... /* This procedure executes KILL for all connections in the specified database. ... to restore myBase form the disk file MyBackup.bak, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Restore Fail
    ... In SQLServer 2000 With enterprise manager, All Tasks -> Detach Database -> Dialg, that dialog allows you to disconnect everyone... ... Can I disconnect all connections by program? ... to restore myBase form the disk file MyBackup.bak, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Restore database
    ... The DISK= keyword is required when restoring from a disk file instead of a ... RESTORE DATABASE MyNwind ... > RESTORE DATABASE MyNwind ...
    (microsoft.public.sqlserver.programming)