Board index » delphi » NULL parameter in StoredProc using D6 + SQL2000

NULL parameter in StoredProc using D6 + SQL2000

Hi Guys,

We have developed an application for the web that calls some stored
procedures resident on SQL2000 with some parameters. Running under D5
everything run perfect but when compiled with D6 it does not take the line
with the parameter being set to NULL.

The code below is the one that run OK with Delphi5 but does not compile
under Delphi6. What has to be done different from D5 in D6??

TIA,
Alfredo

                with SP_Test do
                     begin
                          Close;
                          Parameters.ParamValues['@DtIni'] := vDate1;
                          Parameters.ParamValues['@DtFin'] := vDate2;
                          if Length(vLocal) = 0 then
                             Parameters.ParamValues['@Loc'] := NULL
                          else
                             Parameters.ParamValues['@Loc'] := vLocal;
                          Open;
                     end;

 

Re:NULL parameter in StoredProc using D6 + SQL2000


Alfredo,

   Add Variants to your Uses clause or use the Clear method.

Parameters.ParamValues['@Loc'].Clear

Good luck,
krf

Quote
Alfredo Bianco <abia...@picture.com.br> wrote in message

news:3bb8b4b4_1@dnews...
Quote
> with D6 it does not take the line with the parameter being set to NULL.

Other Threads