> Couldn't resist trying this one out.

You are more keen than I was - I simply moved on... <g>
> Well, my test worked just as expected, Prepare'd or no.  BUT 
> having said that, I remember having a similar problem when using Delphi 4,
where
> Clear'ing the parameter seemed to require me to set the datatype as well
as
> the value (I never worked it out properly and I'm using D5 now so things
> _may_ be different).  Grant, could you try this code and see 
> what you get?
The code won't actually show the problem - I had put a break point in &
checked that the params where being set correctly - they are & bound is
being set correct.  You have to actually fire the query (I stuck a .ExecSQL
in the end of your showquery proc).  Under D4 for the resulting table was
displayed correctly - ie with the following mod to your code
    params[0].AsString := 'A';
    params[1].Clear;
    showquery; // Should be: not bound, yes, blank

    params[0].asinteger := 'B';
    params[1].asdatetime := now;
    showquery; // Should be: bound, yes, "now"
    ....

I got in my table: 
 A  null
 B  date time
 C  null
 D  date time

I hate to mention it but the problem I found was on an old D1 app (hence my
concern about Y2K), and when I run your test app under D1 I get the params
looking fine but the resulting table looks like:
 A null 
 B null
 C null
 D null

I don't know about D2 and/or D3.... would be interesting to see when it was
fixed...

> It couldn't be a problem specific to parameterised Insert 
> statements - could it????  
Yes - I think it is. I do not have the D1 source on the machine I am using
at the moment and being found in a old app & delphi version I pretty much
don't care too much (I have checked the rest of the app & this is the only
time a param.clear is done).

> Did you set the datatype and paramtype of all the params before you
> began?
Yeah - all set correctly at designtime


Regards,
Grant
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to