Home > Archive > SQL Anywhere database > December 2005 > Save Image/Picture in Sybase 5.5









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Save Image/Picture in Sybase 5.5
John Vai

2005-09-07, 3:23 am

Dear Experts:
It seems that i cannot save images more than 32K of size .

I am using VB6.0 to connect to Sybase. Is there any way that I can store
pictures more than 32k in Sybase?
Please note that i have seen other applications based on Sybase 5.5 can
store images bigger than 32k in size.

Any solution will be highly appreciated.

John Vai


Greg Fenton

2005-09-07, 3:23 am

John Vai wrote:
> Dear Experts:
> It seems that i cannot save images more than 32K of size .
>


What is the definition of the column you are trying to store the image into?

Can you show us the code you are using to store the binary image into
the column?

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Ian McHardy

2005-09-07, 9:23 am

Before ASA 8, you could not fetch more than 32K using a bound column, but
you can using get data and fetching the data in chunks. In PB 8, you can
use SELECTBLOB to fetch more than 32K, but I don't remember if you need to
do anything special to insert more than 32K.

--

Ian McHardy (iAnywhere Solutions)

Please reply only to the newsgroup.

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer
"John Vai" <john_vai[at]hotmail[dot]com> wrote in message
news:431e4294$1@foru
ms-1-dub...
> Dear Experts:
> It seems that i cannot save images more than 32K of size .
>
> I am using VB6.0 to connect to Sybase. Is there any way that I can store
> pictures more than 32k in Sybase?
> Please note that i have seen other applications based on Sybase 5.5 can
> store images bigger than 32k in size.
>
> Any solution will be highly appreciated.
>
> John Vai
>



John Vai

2005-09-09, 9:25 am

Dear Friends:
I need to save pictures more than 32k. for sure images less than 32k cause
no problem at alll.

To save the data I'm doing the following:
Dim r as new adodb.stream,RecSET as new adodb.recordset
recSET.open "select picc from member where memcode=2001",db, adOpenKeyset,
adLockOptimistic
r.Type = adTypeBinary
r.Open
r.LoadFromFile "c:\egh.bmp"
RecSET("picc") = r.Read
recSET.update

to get the image I'm doing the following:
rs.open "select * from member where memcode=2001",db,adOpenKeyset,
adLockOptimistic
If (Not IsNull(Rs!picc)) Or (Len(Rs!picc) > 0) Then
r.Type = adTypeBinary
r.Open '
r.Write Rs("picc")
r.SaveToFile "C:\temp.jpg", adSaveCreateOverWrit
e
On Error Resume Next
Image1.Picture = LoadPicture("c:\temp.jpg")
r.Close
Else
Image1.Picture = LoadPicture("")
Image1.Tag = ""
End If

END!

"Ian McHardy" < mchardy_no@spam_iany
where.com> wrote in message
news:431eea83$1@foru
ms-2-dub...
> Before ASA 8, you could not fetch more than 32K using a bound column, but
> you can using get data and fetching the data in chunks. In PB 8, you can
> use SELECTBLOB to fetch more than 32K, but I don't remember if you need to
> do anything special to insert more than 32K.
>
> --
>
> Ian McHardy (iAnywhere Solutions)
>
> Please reply only to the newsgroup.
>
> Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
> Developer Community at http://www.ianywhere.com/developer
> "John Vai" <john_vai[at]hotmail[dot]com> wrote in message
> news:431e4294$1@foru
ms-1-dub...
>
>



Chris Keating \(iAnywhere Solutions\)

2005-09-09, 11:23 am

See http://www.ianywhere.com/whitepapers/ado_vb_access.html which provides
exaples of working with BLOB data.


"John Vai" <john_vai[at]hotmail[dot]com> wrote in message
news:43219c9f@forums
-2-dub...
> Dear Friends:
> I need to save pictures more than 32k. for sure images less than 32k cause
> no problem at alll.
>
> To save the data I'm doing the following:
> Dim r as new adodb.stream,RecSET as new adodb.recordset
> recSET.open "select picc from member where memcode=2001",db, adOpenKeyset,
> adLockOptimistic
> r.Type = adTypeBinary
> r.Open
> r.LoadFromFile "c:\egh.bmp"
> RecSET("picc") = r.Read
> recSET.update
>
> to get the image I'm doing the following:
> rs.open "select * from member where memcode=2001",db,adOpenKeyset,
> adLockOptimistic
> If (Not IsNull(Rs!picc)) Or (Len(Rs!picc) > 0) Then
> r.Type = adTypeBinary
> r.Open '
> r.Write Rs("picc")
> r.SaveToFile "C:\temp.jpg", adSaveCreateOverWrit
e
> On Error Resume Next
> Image1.Picture = LoadPicture("c:\temp.jpg")
> r.Close
> Else
> Image1.Picture = LoadPicture("")
> Image1.Tag = ""
> End If
>
> END!
>
> "Ian McHardy" < mchardy_no@spam_iany
where.com> wrote in message
> news:431eea83$1@foru
ms-2-dub...
>
>



John Vai

2005-12-16, 9:23 am

Dear Chris:

I have checked and tried the code samples and the pdf file that you have
provided me, and thanks anyways, but I still can't save images on the Sybase
5.5.5 database with pictures larger than 32K. Please note that for the same
database and version/build, other applications are saving pictures/images
with pictures larger than 32k.

I guess that there's a technique that we miss, right?

any other hints??

Thanks.
John Vai

"Chris Keating (iAnywhere Solutions)" < Spam_NoThanks_keatin
g@iAnywhere.com>
wrote in message news:4321a6bd$1@foru
ms-2-dub...
> See http://www.ianywhere.com/whitepapers/ado_vb_access.html which provides
> exaples of working with BLOB data.
>
>
> "John Vai" <john_vai[at]hotmail[dot]com> wrote in message
> news:43219c9f@forums
-2-dub...
>
>



Chris Keating(iAnywhere Solutions)

2005-12-16, 9:23 am

Did you use the .AppendChunk and .GetChunk methods required to handle >32k?

See
http://msdn.microsoft.com/library/d...ppendchunkx.asp
--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

********************
********************
********************
*****************
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

********************
********************
********************
*****************

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use Case Express to report bugs http://case-express.sybase.com

********************
********************
********************
*****************
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com