Página 1 de 1

TSQLTable: save long binary data to file

Publicado: Vie Ago 03, 2007 7:30 am
por Guest
Hi,
how can I save the content of a long binary data field from a SQLTable (MS
Access) to a file?
Best regard, Timm.

TSQLTable: save long binary data to file

Publicado: Vie Ago 03, 2007 11:54 am
por jfgimenez
Timm,
> how can I save the content of a long binary data field from a SQLTable (MS
> Access) to a file?
Use the field value from the dataset directly. Something like:
hFile := FCreate( "SomeFile.dat" )
FWrite( hFile, ::oDataSet:LongBinaryField, Len(
::oDataSet:LongBinaryField ) )
FClose( hFile )
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

TSQLTable: save long binary data to file

Publicado: Vie Ago 03, 2007 11:54 am
por jfgimenez
Timm,
> how can I save the content of a long binary data field from a SQLTable (MS
> Access) to a file?
Use the field value from the dataset directly. Something like:
hFile := FCreate( "SomeFile.dat" )
FWrite( hFile, ::oDataSet:LongBinaryField, Len(
::oDataSet:LongBinaryField ) )
FClose( hFile )
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

TSQLTable: save long binary data to file

Publicado: Vie Ago 03, 2007 5:47 pm
por Guest
Jose,
many thanks for your answer!
I already tried something similar to your solution but I can´t open
the created file. I expected to get a graphic file (bmp or jpg) but the
file seems to have an other content.
Best regards, Timm.
"Jose F. Gimenez" <jfgimenez@wanadoo.es> schrieb im Newsbeitrag
news:[email=46b2fb58@ozsrv2.ozlan.local...]46b2fb58@ozsrv2.ozlan.local...[/email]
> Timm,
>
>> how can I save the content of a long binary data field from a SQLTable
>> (MS Access) to a file?
>
> Use the field value from the dataset directly. Something like:
>
> hFile := FCreate( "SomeFile.dat" )
> FWrite( hFile, ::oDataSet:LongBinaryField, Len(
> ::oDataSet:LongBinaryField ) )
> FClose( hFile )
>
> --
> Regards,
>
> Jose F. Gimenez
> http://www.xailer.com
> http://www.xailer.info
>

TSQLTable: save long binary data to file

Publicado: Vie Ago 03, 2007 5:47 pm
por Guest
Jose,
many thanks for your answer!
I already tried something similar to your solution but I can´t open
the created file. I expected to get a graphic file (bmp or jpg) but the
file seems to have an other content.
Best regards, Timm.
"Jose F. Gimenez" <jfgimenez@wanadoo.es> schrieb im Newsbeitrag
news:[email=46b2fb58@ozsrv2.ozlan.local...]46b2fb58@ozsrv2.ozlan.local...[/email]
> Timm,
>
>> how can I save the content of a long binary data field from a SQLTable
>> (MS Access) to a file?
>
> Use the field value from the dataset directly. Something like:
>
> hFile := FCreate( "SomeFile.dat" )
> FWrite( hFile, ::oDataSet:LongBinaryField, Len(
> ::oDataSet:LongBinaryField ) )
> FClose( hFile )
>
> --
> Regards,
>
> Jose F. Gimenez
> http://www.xailer.com
> http://www.xailer.info
>

TSQLTable: save long binary data to file

Publicado: Lun Ago 06, 2007 10:29 am
por jfgimenez
Timm,
> many thanks for your answer!
> I already tried something similar to your solution but I can´t open
> the created file. I expected to get a graphic file (bmp or jpg) but the
> file seems to have an other content.
Perhaps it contains an 'OLE object', that is, an 'OLE compound document'. If
so, I'm affraid it's not an easy task to get it. You'll have to deal
directly to several COM interfaces at low level.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

TSQLTable: save long binary data to file

Publicado: Lun Ago 06, 2007 10:29 am
por jfgimenez
Timm,
> many thanks for your answer!
> I already tried something similar to your solution but I can´t open
> the created file. I expected to get a graphic file (bmp or jpg) but the
> file seems to have an other content.
Perhaps it contains an 'OLE object', that is, an 'OLE compound document'. If
so, I'm affraid it's not an easy task to get it. You'll have to deal
directly to several COM interfaces at low level.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

TSQLTable: save long binary data to file

Publicado: Mar Ago 07, 2007 4:10 pm
por Guest
Jose,
yes, it contains an 'OLE object'.
Best regards, Timm.
"Jose F. Gimenez" <jfgimenez@wanadoo.es> schrieb im Newsbeitrag
news:46b6dbde$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Timm,
>
>> many thanks for your answer!
>> I already tried something similar to your solution but I can´t open
>> the created file. I expected to get a graphic file (bmp or jpg) but the
>> file seems to have an other content.
>
> Perhaps it contains an 'OLE object', that is, an 'OLE compound document'.
> If so, I'm affraid it's not an easy task to get it. You'll have to deal
> directly to several COM interfaces at low level.
>
> --
> Regards,
>
> Jose F. Gimenez
> http://www.xailer.com
> http://www.xailer.info
>

TSQLTable: save long binary data to file

Publicado: Mar Ago 07, 2007 4:10 pm
por Guest
Jose,
yes, it contains an 'OLE object'.
Best regards, Timm.
"Jose F. Gimenez" <jfgimenez@wanadoo.es> schrieb im Newsbeitrag
news:46b6dbde$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Timm,
>
>> many thanks for your answer!
>> I already tried something similar to your solution but I can´t open
>> the created file. I expected to get a graphic file (bmp or jpg) but the
>> file seems to have an other content.
>
> Perhaps it contains an 'OLE object', that is, an 'OLE compound document'.
> If so, I'm affraid it's not an easy task to get it. You'll have to deal
> directly to several COM interfaces at low level.
>
> --
> Regards,
>
> Jose F. Gimenez
> http://www.xailer.com
> http://www.xailer.info
>