Board index » delphi » Binary data via BLOB?

Binary data via BLOB?

Thank you. I'll try this out!

WebEmperor

Brian Bushay TeamB schrieb:

Quote
> > I must be able to
> >read it from the db and put it back into the array. What type of field
> >do I have to use and how do I write and read the binary data? If someone
> >knows the solution, then please mail it to me. I would be happy if you
> >(the one who knows the answer) include some sample code. I tried to use
> >a BLOB but I failed...  PLEASE HELP!

> >This is the array:   Buffer1: Array[0..199] of Char;

> A bytes field should work fine
> To read data
> Table1.fieldbyName('yourField').getData(buffer1);

> To write it

> Table1.fieldbyName('yourField').setData(buffer1);

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

 

Re:Binary data via BLOB?


Quote
>WebEmperor wrote:

>My current problem with a PARADOX 7 database is, that I have binary >data stored in an array of char and I now seek for an solution to store >it inside the database, but without changing the data. I must be able >to read it from the db and put it back into the array. What type of >field do I have to use and how do I write and read the binary data?

Mighty Emperor,

With all the due respect: how about a TBinaryField?
________
Andreas

Re:Binary data via BLOB?


Quote
>But I could'nt figure out how to do the same using
>ADO with both access and dbf file formats.
>Any ideas?

Sorry I am not following what you are trying to do?

I have used a variant array of Varbyte to assign data to a binary field in a
TadoDataSet.  Is that what you are trying to do?

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Binary data via BLOB?


Brian Bushay TeamB <BBus...@Nmpls.com> wrote in message
news:38b18723.28805749@floyd...

Quote

> >But I could'nt figure out how to do the same using
> >ADO with both access and dbf file formats.
> >Any ideas?
> Sorry I am not following what you are trying to do?

> I have used a variant array of Varbyte to assign data to a binary field in
a
> TadoDataSet.  Is that what you are trying to do?

I was trying to find a "universal" solution for .db, .mdb and .dbf(version3)
files.
Then I only had to switch connections in different parts of program. Just
dreaming ...
And i can't use higher version of .dbf. Actually I just want to write ESRI
shapefiles -
it was easy to write .shp/.shx  file, now I need to put some binary data
into .dbf part,
yet to be readable/acceptable for ArcView.

Thanks
Harri

Re:Binary data via BLOB?


Quote
>I was trying to find a "universal" solution for .db, .mdb and .dbf(version3)
>files.
>Then I only had to switch connections in different parts of program. Just
>dreaming ...
>And i can't use higher version of .dbf. Actually I just want to write ESRI
>shapefiles -
>it was easy to write .shp/.shx  file, now I need to put some binary data
>into .dbf part,
>yet to be readable/acceptable for ArcView.

Still not clear

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Binary data via BLOB?


Brian Bushay TeamB <BBus...@Nmpls.com> wrote in message
news:38b21450.22600782@floyd...

Quote
> >I was trying to find a "universal" solution for .db, .mdb and
.dbf(version3)
> >files.

> Still not clear

Is it possible to store binary data (~100bytes) in .dbf3 files somehow.
Resulting table must still be readable by programs that understand
only .dbf3 format.  I tried to UUENCODE info into Character field but
somehow it didn't work. Mus try again I guess.
As I understood, type Binary is supported only
starting from DBase for Windows+

I want to be able to read/write same info to/from all these 3 different
table
formats by changing only one thing in program - datasource.

How about some cool untold trick?

Thanks
Harri

Re:Binary data via BLOB?


On Tue, 22 Feb 2000 19:01:29 +0200, "Harri R?uk" <ha...@uninet.ee>
wrote:

Quote
>Is it possible to store binary data (~100bytes) in .dbf3 files somehow.
>Resulting table must still be readable by programs that understand
>only .dbf3 format.

You must convert the binary data to a valid string for dBaseIII memo
fields.  When it is usually not longer than 100 bytes, you can simply
convert the hex values to a string.
E.g.:
  $05 $02 $08 $F2
to
  "050208F2"
This doubles the number of bytes needed to store the memo field, but
since dBaseIII memo files have a minimal block size of 512 bytes
anyway, that would only make your DBT file bigger if your binary data
exceeds 255 bytes.

Quote
>As I understood, type Binary is supported only
>starting from DBase for Windows+

The dBase IV .DBT format also supports the storage of binary data.

HTH,

Jan

Re:Binary data via BLOB?


Quote
>Is it possible to store binary data (~100bytes) in .dbf3 files somehow.
>Resulting table must still be readable by programs that understand

I don't keep up on the peculiarities of dbase fields so I suggest you follow
Jan's advice

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads