Board index » delphi » SQL Server 7.0 Could Not find Stored Procedure

SQL Server 7.0 Could Not find Stored Procedure

I'm having trouble in executing a stored procedure in Delphi 3.0 C/S with
BDE 5.0 in a SqlServer 7.0.  The code works fine in SqlServer 6.5.

The stored procedure is in the server, but the program just seems unable to
see it. It issues the message "Could not find stored procedure INS_ALUNO" .
I've tryed to change the name, rewrite the procedure but the problem
remains.

Everything else on the application  seems to be working fine. I can update,
delete, insert data on several tables. I just can't run stored procedures.
Do I need to change something in my code ?  If  I do a trace on the server
side I can see the program trying to call the procedure, and  it seems to
execute, but then the error message pops up on the terminal side.

Can anyone help me?

Thank's in advance

--
Jo?o Manuel de Carvalho Vaz
UDS Unidade de Desenvolvimento de Software
CESAE - Centro de Servi?os e Apoio s Empresas

Visite o nosso site: http://www.cesae.pt

 

Re:SQL Server 7.0 Could Not find Stored Procedure


The problem is that SQL 7.0 eliminated the SYSPROCEDURES table, and as a
result objects (Stored procedures) cannot be overloaded..

In previous versions of Delphi, a ";1" after the name of the component
would indicate what version you wanted to use.

Just remove the ";1" in the name or use a method like below in your
DataModule's OnCreate() handler...

procedure strip_Overloading_Indicator_From_SPs( Component: TComponent );
var
  I, S: integer;
  SPN: string;
  Params: TParams;
begin
  Params := TParams.Create;
  TRY
  with Component do
  begin
    for I := 0 to ComponentCount - 1 do
    begin
      if Components[ I ] is TStoredProc then
      begin
        SPN := TStoredProc( Components[ I ] ).StoredProcName;
        S := pos( ';1', SPN );
        if S > 0 then
        begin
          Params.Assign( TStoredProc( Components[ I ] ).Params );
          Delete( SPN, S, 2 );
          TStoredProc( Components[ I ] ).StoredProcName := SPN;
          TStoredProc( Components[ I ] ).Params.Assign( Params );
        end;
      end;
    end;
  end;
  FINALLY
  Params.Free;
  END;
end;

HTH

Rkr

Quote
"Jo?o Vaz" wrote:

> I'm having trouble in executing a stored procedure in Delphi 3.0 C/S with
> BDE 5.0 in a SqlServer 7.0.  The code works fine in SqlServer 6.5.

> The stored procedure is in the server, but the program just seems unable to
> see it. It issues the message "Could not find stored procedure INS_ALUNO" .
> I've tryed to change the name, rewrite the procedure but the problem
> remains.

> Everything else on the application  seems to be working fine. I can update,
> delete, insert data on several tables. I just can't run stored procedures.
> Do I need to change something in my code ?  If  I do a trace on the server
> side I can see the program trying to call the procedure, and  it seems to
> execute, but then the error message pops up on the terminal side.

> Can anyone help me?

> Thank's in advance

> --
> Jo?o Manuel de Carvalho Vaz
> UDS Unidade de Desenvolvimento de Software
> CESAE - Centro de Servi?os e Apoio s Empresas

> Visite o nosso site: http://www.cesae.pt

Other Threads