Subject Re: [firebird-support] Service Manager SPB (Parameter Buffer)
Author Danie van Eeden
Doesnt seem like the issue is with the password. I have found that if
the first by of the string is "1" then I connect without errors.
If the first byte is "2" then I get "clumpet too long error" ie. the
buffer stopped before clumped fully read (by clumpet they refer to a
subsection of the string containing a section of information). From what
I can figure its interpreting the "2" as a length of whatever is to
follow. From all other code examples interfacing with the API it looks
very much the same as mine - see below: however I am unsure of why the
API is returning the error.

Code:
var
I, Pos, PValue: Integer;
ParamNo: Word;
SPB, Buffer, ParamName, ParamValue: AnsiString;
begin
FSPBLength := 2;
SPB := AnsiChar(isc_spb_version1) + AnsiChar(isc_spb_current_version);

For I := 0 to Params.Count - 1 Do
Begin
Buffer := Params.Strings[I];
Pos := FirstDelimiter(' ='#9#10#13, Buffer);
if POS = 0 then
ParamName := Buffer
else
begin
ParamName := Copy(Buffer, 1, Pos - 1);
Delete(Buffer, 1, Pos);
ParamValue := Buffer;
end;

ParamNo := GetInterBase6ServiceParamNumber(ParamName);
case ParamNo of
0: Continue;
isc_spb_user_name, isc_spb_password:
Begin
SPB := SPB + AnsiChar(ParamNo) + AnsiChar(Length(ParamValue)) +
ParamValue;
Inc(FSPBLength, 2 + Length(ParamValue));
End;
end;

End;
end;

Result:
' Invalid clumplet buffer structure: buffer end before end of clumplet -
clumplet too long

If I leave out the isc_spb_current_version end decrease the length by 1,
it works fine (for this case), but I need to know if its just
coincidence or if Im doing something wrong in general.

Help appreciated

On 2012/07/19 09:56 AM, Koenraad Lelong wrote:
>
> On 18-07-12 20:56, dve83 wrote:
> > Hi, busy connecting to the service manager via the API.
> > According to Interbase 6 API Guide I need to prep the SPB with the
> following
> >
> > isc_spb_version1
> > isc_spb_current_version
> > isc_spb_user_name
> > Length(6) of Username
> > username
> > isc_spb_password
> > Length(9) of password
> > password
> >
> > my result in AnsiString looks likes this
> > #1#2#$1C#6'SYSDBA'#$1D#9'masterkey'
> >
> > SPBLength = 21
> >
> > this seems correct according to the spec in the API, however I keep
> > getting the following Interbase message
> >
> > ' Invalid clumplet buffer structure: buffer end before end of clumplet -
> > clumplet too long'
> >
> > To me this means that either section 'username' or 'password' is beyond
> > the length of the buffer.
> > HOWEVER, if I remove the isc_spc_current_version and decrease SPBLength
> > by 1, all is good and the connection to Service Manager is made. What am
> > I missing?
> >
>
> Hi,
>
> I don't know if it's anything to do with your problem, but AFAIK,
> Firebird passwords are max. 8 characters long.
>
> Regards,
>
> Koenraad Lelong
>
>



[Non-text portions of this message have been removed]