FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BLOB in SQL statement
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
BLOB in SQL statement
Posted: Thu Feb 25, 2010 01:15 AM

Hello All,

Im Using Ads 8.1 How can I save BLOB (image) via SQL script/command?

I tried:

AdsPrepareSQL()

AdsSetBinary()

AdsExecuteSQL()

But "Error: Unresolved external.." on ADSSETBINARY()

Any help?

Regards,
FAP

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BLOB in SQL statement
Posted: Thu Feb 25, 2010 10:26 AM
This is not direct answer to your question.
But i we want to store images in ADT table, we can easily store then and retrieve them in IMAGE type column. We can store and retrieve image data just like a memo field.

Please see \fwh\samples\xbradt.prg. The images stored can be browsed inline and also printed by report method of xbrowse

Here is a screen shot from xbradt.prg:


When it is so simple to handle images, why should be bothered to adopt more complex blob methods?
Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: BLOB in SQL statement
Posted: Fri Feb 26, 2010 12:40 AM
Dear RAO,

My simple method is this function to put image (blob) into the table (ADT/FoxPro)...

Code (fw): Select all Collapse
lSaved := BLOB->( AdsFile2Blob(cImgFile, 'PICTURE', ADS_IMAGE) )


works all the time.

But I have this SQL string/command which I need to include the blob fields to insert the image.

btw,
the connection is via internet.


I wish to discuss the subject further.

My best regards,
FAP
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BLOB in SQL statement
Posted: Fri Feb 26, 2010 03:15 AM

The simplest thing I do ( ADT, ADS_CDX and DBFCDX ) is this:

ALIAS->FIELDNAME := MemoRead( <imagefile> )

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: BLOB in SQL statement
Posted: Fri Feb 26, 2010 03:49 AM

Thanks RAO for the advise. :)

Regrads,
FAP

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15

Continue the discussion