Board index » delphi » Delphi3 and MS Access query (ODBC Ok / Native Driver Error)

Delphi3 and MS Access query (ODBC Ok / Native Driver Error)

Can anyone help me here ?

I can successfully run the following TQuery while using the ODBC driver

  select * from survey where hh_pub = :hh_pub;

and pass the following parameter

  Query1.Close;
  Query1.ParamByName('hh_pub').AsString := '926200401';
  Query1.Open;

However when attempting to use the Native Driver for Access I receive the
following error

General SQL error.
Syntax error in PARAMETER clause.

I am using the Delphi 3 (Maint#2) and BDE 5.0
Please also note that if I use a TQuery with no Parameters defined it works.

Thanks in advance

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

 

Re:Delphi3 and MS Access query (ODBC Ok / Native Driver Error)


After editing the SQL have you then gone into the
property TQuery.Params and preset then parameter to a string type.
Without being told the compiler initialise the param to type variant.

Of course this does assume that field is of type string.

Quote
paul_felst...@my-dejanews.com wrote:
> Can anyone help me here ?
> I can successfully run the following TQuery while using the ODBC driver
>      select * from survey where hh_pub = :hh_pub;
> and pass the following parameter
>      Query1.Close;
>      Query1.ParamByName('hh_pub').AsString := '926200401';
>      Query1.Open;
> However when attempting to use the Native Driver for Access I receive the
> following error
>      General SQL error.
>      Syntax error in PARAMETER clause.
> I am using the Delphi 3 (Maint#2) and BDE 5.0
> Please also note that if I use a TQuery with no Parameters defined it works.

Other Threads