HELP: Converting delphi project from MS-SQL to SQL Anywhere 5.5

Hi All

We are converting one of our products from MS SQLServer to Sybase SQL Anywhere
so that we can do a lite 1-5 user laptop version.

Have done the Tables,Indexes,DRI,Stored Procs and are using The SQL Anywhere
ODBC driver via the BDE instead of SQL Links version of MSSQL

Versions
=========
Delphi C/S 3
BDE 5 (Tried with 4.51)
SQL Anywhere 5.504

I have tested the stored procs in question under isql and they work fine,
however when I run under delphi the first stored proc runs fine but then the
second one allways raises by Delphi error when I check the result code as an
example here is a code fragment . When I call CheckLogin followed by
GetProducts GetProducts raises the delphi error, however if I comment out
CheckLogin then GetProducts works fine. this happens progressivly down if I
comment out parts of the code

Is there any special setup I have to do with SQL Anywhere that I may not be
aware of, it seems as if something is not cleaning up properly after the first
stored proc call.

Below is the code fragment (the two functions that are called)

--------- fragment start -----------------

 procedure CheckLogin;
  begin
    with TStoredProc.Create(FOwner) do
    try
      SessionName := FSession.SessionName;
      DatabaseName := FDatabase.DatabaseName;
      StoredProcName := spCheckLogin;
      CreateResultParam(Params);
      ExecProc;
      if Params.ParamValues['Result'] <> 0 then
          raise ESCSSessionError.Create('Invalid Logon');
      Open;
      if not EOF then
      begin
        FTimeOut := GetInteger(FieldValues['TIMEOUT']);
        FDemo := GetBoolean(FieldValues['DEMO']);
        FTrial := GetBoolean(FieldValues['TRIAL']);
        FTrialStart := GetInteger(FieldValues['TRIALSTART']);
        FCustID := GetCustID(FieldValues['CUST_ID']);
        FDescription := GetString(FieldValues['DESCR']);
      end;
      Close;
    finally
      Free;
    end;
  end;

 procedure GetUserProducts;
  begin
    with TStoredProc.Create(FOwner) do
    try
      SessionName := FSession.SessionName;
      DatabaseName := FDatabase.DatabaseName;
      StoredProcName := spGetProductsByUser;
      CreateResultParam(Params);
      CreateStringParam(Params, '@USER_ID', FUserID);
      ExecProc;
      if Params.ParamValues['Result'] <> 0 then
        raise ESCSSessionError.Create('Unable to retrieve Products');
      Open;
      while not EOF do
      begin

FAccessList.Add(TSCSAccessItem.Create(GetString(FieldValues['PROD_ID']),
GetBoolean(FieldValues['PREAD']), GetBoolean(FieldValues['PWRITE'])));
        Next;
      end;
      Close;
    finally
      Free;
    end;
  end;

--------- fragment stop -----------------

It may in fact be something I have to set in SQL Anywhere

any help would be greatly appreciated, thanks in advance

Roger

rog...@albury.net.au