Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Binary field problem

5 posts in Xbase++ Last posting was on 2008-04-24 12:09:53.0Z
Toma? Grom Posted on 2008-04-21 15:55:17.0Z
From: "Toma? Grom" <tomaz.grom@siol.net>
Newsgroups: Advantage.Xbase++
Subject: Binary field problem
Date: Mon, 21 Apr 2008 17:55:17 +0200
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 89.212.202.125
Message-ID: <480cb7e5@solutions.advantagedatabase.com>
X-Trace: 21 Apr 2008 09:51:01 -0700, 89.212.202.125
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.212.202.125
Xref: solutions.advantagedatabase.com Advantage.Xbase++:945
Article PK: 1140792

If I make a binary field from xBase++ through ADSDBE and ADS data dictionary
into DBF/CDX data table, everything seems all right, even ARC shows, that
the field is of type Binary, but when I fill it with .JPG picture, it is
somehow corrupted, because I can not get the picture out any more.

Then I change the field inside ARC into memo, save it and then return back
to Binary and save.

Afther that I do not have any problem with retreiving pictures from it any
more.

So it must be something, that even ARC tool does not detect as wrong or
different, but it is wrong somewhere deeper in structure.

So I am able to avoid the problem manually , but because all other processes
are automatic, I would like to keep also database structure creation
automatic, like I was used form FOXCDX RDD.

Can somebody please tell me, if he encountered something symilar.

Best regards

Toma?


Toma? Grom Posted on 2008-04-21 15:57:10.0Z
From: "Toma? Grom" <tomaz.grom@siol.net>
Newsgroups: Advantage.Xbase++
References: <480cb7e5@solutions.advantagedatabase.com>
Subject: Re: Binary field problem
Date: Mon, 21 Apr 2008 17:57:10 +0200
Lines: 5
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 89.212.202.125
Message-ID: <480cb853@solutions.advantagedatabase.com>
X-Trace: 21 Apr 2008 09:52:51 -0700, 89.212.202.125
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.212.202.125
Xref: solutions.advantagedatabase.com Advantage.Xbase++:946
Article PK: 1140793

To be more precise, when I switch to Memo and than back to Binary inside
ARC, I do not have problems with newly added pictures, those imported before
are of course lost ....


Thomas Braun Posted on 2008-04-22 14:28:55.0Z
From: Thomas Braun <spam@software-braun.de>
Subject: Re: Binary field problem
Newsgroups: Advantage.Xbase++
User-Agent: 40tude_Dialog/2.0.12.1de Hamster/2.0.0.1
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Reply-To: tb@software-braun.de
Organization: -
References: <480cb7e5@solutions.advantagedatabase.com> <480cb853@solutions.advantagedatabase.com>
Date: Tue, 22 Apr 2008 16:28:55 +0200
Message-ID: <1m84k4iuhcj5r$.11y4wsm0bnzau.dlg@40tude.net>
X-face: %-(aBVgd7nt]d6N)6E`Q_-BSc/N'c@a}iI.JiL<PY&$A["ow)h5C9~#'ebv5XMN(PW6''gj <~="X,W!%o$(B~O>~?(:i@?WEX`+RlyGgWBRh]76@ozentt`5cvH5z3VY!y\WU^uX3unmh_(\fW8b= qrwM$+J%bt_EQ=
NNTP-Posting-Host: 217.91.28.25
X-Trace: 22 Apr 2008 08:23:12 -0700, 217.91.28.25
Lines: 10
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!217.91.28.25
Xref: solutions.advantagedatabase.com Advantage.Xbase++:947
Article PK: 1140791


Toma? Grom wrote:

> To be more precise, when I switch to Memo and than back to Binary inside
> ARC, I do not have problems with newly added pictures, those imported before
> are of course lost ....

Show us Xbase++ code of how you create the file...

regards
thomas


Tomaz Grom Posted on 2008-04-22 16:49:04.0Z
From: "Tomaz Grom" <tomaz.grom@siol.net>
Newsgroups: Advantage.Xbase++
References: <480cb7e5@solutions.advantagedatabase.com> <480cb853@solutions.advantagedatabase.com> <1m84k4iuhcj5r$.11y4wsm0bnzau.dlg@40tude.net>
Subject: Re: Binary field problem
Date: Tue, 22 Apr 2008 18:49:04 +0200
Lines: 69
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 89.212.202.125
Message-ID: <480e15fd@solutions.advantagedatabase.com>
X-Trace: 22 Apr 2008 10:44:45 -0700, 89.212.202.125
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.212.202.125
Xref: solutions.advantagedatabase.com Advantage.Xbase++:948
Article PK: 1140794

Thanks, Thomas!

In short:

Aadd(aStructure, { 'SIFSLIKE', 'C', 5, 0 } )
Aadd(aStructure, { 'BINSLIKA', 'V', 4, 0 } )

.
.

FOR i:=1 TO Len(aStructure)
cName := aStructure[i,1]
DO CASE
CASE Upper(aStructure[i,2]) == "C"
cType := "Char"
cLen := Alltrim(Str(aStructure[i,3]))
cDec := ""
CASE Upper(aStructure[i,2]) == "N"
cType := "Numeric"
cLen := Alltrim(Str(aStructure[i,3]))
cDec := Alltrim(Str(aStructure[i,4]))
CASE Upper(aStructure[i,2]) == "D"
cType := "Date"
cLen := Alltrim(Str(aStructure[i,3]))
cDec := ""
CASE Upper(aStructure[i,2]) == "L"
cType := "Logical"
cLen := Alltrim(Str(aStructure[i,3]))
cDec := ""
CASE Upper(aStructure[i,2]) == "M"
cType := "Memo"
cLen := Alltrim(Str(aStructure[i,3]))
cDec := ""
CASE Upper(aStructure[i,2]) == "V"
cType := "Binary"
cLen := ""
cDec := ""
ENDCASE
cFields += cName + "," + cType
IF !Empty(cLen)//dolzina
cFields += "," + cLen
ENDIF
IF !Empty(cDec)//decimalk
cFields += "," + cDec
ENDIF
IF i != Len(aStructure)//ce ni zadnje polje, locuje s ";"
cFields += ";"
ENDIF
NEXT

DllCall( PAdsDllHandle, DLL_STDCALL, "AdsDDRemoveTable",
PAdsConnectionHandle, cFile, .F.)

nRet := DllCall( PAdsDllHandle, DLL_STDCALL, "AdsCreateTable",;
PAdsConnectionHandle,;
cFile,;
cFile,; //alias
ADS_CDX,; //table type
ADS_OEM,; //char type
ADS_PROPRIETARY_LOCKING,; //locking type
ADS_IGNORERIGHTS,; //check rights
ADS_DEFAULT,; //memo size
cFields,;
@nTableHandle;
)
DllCall( PAdsDllHandle, DLL_STDCALL, "AdsCloseTable", nTableHandle)


Toma? Grom Posted on 2008-04-24 12:09:53.0Z
From: "Toma? Grom" <tomaz.grom@siol.net>
Newsgroups: Advantage.Xbase++
References: <480cb7e5@solutions.advantagedatabase.com> <480cb853@solutions.advantagedatabase.com> <1m84k4iuhcj5r$.11y4wsm0bnzau.dlg@40tude.net> <480e15fd@solutions.advantagedatabase.com>
Subject: Re: Binary field problem
Date: Thu, 24 Apr 2008 14:09:53 +0200
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 89.212.202.125
Message-ID: <4810778e@solutions.advantagedatabase.com>
X-Trace: 24 Apr 2008 06:05:34 -0700, 89.212.202.125
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.212.202.125
Xref: solutions.advantagedatabase.com Advantage.Xbase++:950
Article PK: 1140796

Looks like the answer is:

instad:

CASE Upper(aStructure[i,2]) == "V"
cType := "Binary"
cLen := ""
cDec := ""

to write

CASE Upper(aStructure[i,2]) == "V"
cType := "Binary"
cLen := "10"
cDec := ""