Migration from ADO to SDAC.

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Saupg
Posts: 19
Joined: Wed 05 Nov 2008 11:53

Migration from ADO to SDAC.

Post by Saupg » Wed 10 Jun 2009 06:07

Hello!

I have such code:

Code: Select all

var
  spOper: TADOStoredProc;
begin
  ....
  spOper.ProcedureName := ProcName;
  if spOper.Parameters.Refresh then
    spOper.Parameters.ParamByName('Param').Value := AValue;
  else
    Exception.CreateFmt('Stored proc ''%s'' not found', [ProcName]);
How i can rewrite it using SDAC? I need to check stored proc.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 10 Jun 2009 13:31

You can't know if the procedure exist until you try to execute it, using, for example, the ExecProc method.
If you need to get list stored procedure names you should use the TMSConnection.GetStoredProcNames method.

Post Reply