Board index » delphi » I'm having an ADOQuery Parameter problem.

I'm having an ADOQuery Parameter problem.

When I try and open this SQL in a TADOQuery (In the IDE or at runtime) I get
an AccessViolation in
ntdll.dll (cannot assign nil to TInsp ListBox).
I had to manually set the properties of the parameters to make them DateTime
as they were not recognised automatically.
I then get an AV in msado.dll if I then click on any property of the
ADOQuery in the IDE.

SELECT
100 - (sum(cast(isnull(cprminutes,0) as numeric(16,2))))
/
(select sum(cast(isnull(cprcrosscutterhours,0) as numeric(16,2))) * 60
from cprview_datamachinedetails m
where m.startdatetime between :FromDateTime and :ToDateTime
) Availability
from cprview_dataccdowntime d
where d.startdatetime between :FromDateTime and :ToDateTime

If I replace one set of the Parameters with an actual DateTime string, I
have no problems.

Any assistance to resolve this would be appreciated.

Thank you.

Regards,
Shaun Hogarth

Delphi 6 Ent SP2. XP Pro. MSSQLServer2000. LMD Tools 6
~~~~~~~~~~~~~~~~~~~~~~~~~
This message was sent by
Shaun Hogarth from
Perth, Western Australia
~~~~~~~~~~~~~~~~~~~~~~~~~

 

Re:I'm having an ADOQuery Parameter problem.


Quote
>If I replace one set of the Parameters with an actual DateTime string, I
>have no problems.

You should not use a parameter name more than once in a query with Ado
components.  Try changing the names of the second set of parameters.
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads