Create MyStoredProc at runtime What`s is Wrong ?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Daniel Fagnan
Posts: 58
Joined: Fri 13 Oct 2006 00:08

Create MyStoredProc at runtime What`s is Wrong ?

Post by Daniel Fagnan » Fri 08 Aug 2008 13:20

Var proc :tMyStoredProc;
begin
Try

Screen.Cursor :=crHourGlass;

Proc := TmyStoredProc.Create(self);
Proc.Connection := MyConnection1;
Proc.StoredProcName := 'H_CALC';
Proc.Params[0].asString := 'WO000345'
Proc.Prepare;
Proc.ExecProc;
Finally
Proc.Free;
Screen.Cursor := crDefault;
End;

If assign to tMyStoredProc Components all is Ok but if I assign StoredProcName at runtime nothing 8) to execute. Why?

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

Post by Dimon » Mon 11 Aug 2008 12:48

You should add the following code:

Code: Select all

  Proc.PrepareSQL;
after the line:

Code: Select all

  Proc.StoredProcName := 'TestParam';

Post Reply