Hi Mark,
I have tried various iterations of it, as a BYTE and as Pablo Sanchez
suggests in a later response, a CSTRING, eg:
spb_buffer BYTE,DIM(128)
or
spb_buffer CSTRING(128)
As a BYTE, I fill it thus:
spb_buffer[1] = 2! which is also defined as isc_spb_version,
also tried 0010b and 02h
spb_buffer[2] = 2! isc_sbp_current_version
spb_buffer[3] = 28 ! isc_spb_user_name
spb_buffer[4] = 6! length of username
spb_buffer[5] = val('A')! ASCII value of A
etc
As a CSTRING:
spb_buffer[1] = chr(2) ! which returns the ASCII character 2, a
StartOfText (STX), I also tried 0010b and 02h
spb_buffer[2] = chr(2) ! isc_sbp_current_version
spb_buffer[3] = chr(28)! isc_spb_user_name
spb_buffer[4] = chr(6) ! length of username
spb_buffer[5] = 'A'
etc
I get the same error regardless of the data type I choose.
I then pass the ADDRESS(spb_buffer) which is a LONG to
isc_service_attach() which is prototyped as:
isc_service_attach(LONG, USHORT, LONG, LONG, USHORT, LONG),LONG
I have managed to debug my way through up to this point but now I'm
stuck with the error.
Cheers,
Andrew Zenz
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com]
Sent: Tuesday, 14 January 2020 3:53 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] coding for services: invalid clumplet
error
On 13-01-2020 02:34, 'Andrew Zenz' and...@aimsoftware.com.au
[firebird-support] wrote:
> Not sure where to post this but the mailing-list page says (if you
don't
> know where to ask, ask here) so here goes.
>
> We code in a 4GL called Clarion.
>
> With regard to the Service Parameter Buffer, Clarion doesn't have a
CHAR
> data type so we use a BYTE and treat it in a similar way, create an
> array or DIMension
A parameter buffer is effectively an array of bytes (and not (just)
characters), so that is the correct approach.
> I am attempting to attach to a server using isc_service_attach and
keep
> getting the following error:
>
> "Invalid clumplet buffer structure: spb in service attach should begin
> with isc_spb_version1 or isc_spb_version "
That error suggests that the SPB is not well-formed, or at least doesn't
start with byte 0x01 or 0x02.
> I have created the EQUATE (#define in C) for isc_spb_version1 and
> isc_spb_version though in my testing I am using the value 2 and don't
> seem to be getting anywhere.
>
> Hoping I have explained it well enough, perhaps someone that has come
> across this before can enlighten me?
How did you define the SPB?
Mark
--
Mark Rotteveel