TAdoQuery parameters & empty strings

From: Cengis (cengis.kocaurlu_at_prodiag.fr)
Date: 08/30/04


Date: Mon, 30 Aug 2004 17:14:09 +0200

hello,

i have a TAdoQuery for insert and update task in my access database
all parameters values are taken from TEdit
and the query is like 'INSERT INTO mytable(name,...) VALUES(:name,...);'
i use the following code to set parameters values:

myAdoQuery.parameters.parambyname('name').value := MyNameEdit.Text

it work fine when i don't have an empty string in the TEdit, but when
MyNameEdit.Text is empty i get an error (when i execute the query)

[microsoft][Driver ODBC Microsoft Access] value precision not valid

it seems to be specific to the tadoquery component, when i use TQuery
and BDE it work fine (with bde i use param.asString for exemple, but i
don't find where i can specify the conversion type for ADOQuery parameters)

any idea to fix that ?



Relevant Pages

  • Re: Delphi7 / ADO - Origin property of TQuery blank
    ... The tfield.Orgin property of a query should reflect the base table where the ... Why would you wan't to modify that? ... With TADOQuery, the 'Origin' property for all fields are blank at design ... the connection and a simple SQL query, double click on the query and add ...
    (borland.public.delphi.database.ado)
  • TADOQUery creates but does not free SysString
    ... I have a problem with TADOQuery. ... If I create a query containing a parameter ... procedure TForm1.Button1Click(Sender: TObject); ... var I: Integer; ...
    (borland.public.delphi.database.ado)
  • Re: connect to excel
    ... Once I get constructed the connection string, how do I specify the query in ... the TADOQuery? ...
    (borland.public.delphi.database.ado)
  • Update TADOQuery from a Select TADOQuery
    ... FROM `daterep` D, mfest` D1 ... I've got this code in a TADOQuery on a form and I ... The four fields I'm returning exist in Repdate. ... I'd like to fire an update query off this, ...
    (borland.public.delphi.database.ado)