sql ADOQuery problem with access 2000 database .mdb

From: tuxim (no_spam_at_no_spam.org)
Date: 05/29/04


Date: Sat, 29 May 2004 08:28:16 +0200

I have posted this message before on other delphi news boards but never got
any answer to my problem. I can't continue my work without resolving this
problem. Please, can sombody help me ?

I'm working with Delphi 6 and SP2.

I can't access to any numerical fields in my database via ADO.

The following query works fine :

ADOQuery1.Sql.Add('select * from DOSSIER');
ADOQuery1.Sql.Add('where DOS_EMPR_PRENOM = "' +'Maria' +'"');
try
  ADOQuery1.Open;

but the next query generates an error message during the excecution:

ADOQuery1.Sql.Add('select * from DOSSIER');
ADOQuery1.Sql.Add('where DOS_ID = "' +'10' +'"');
try
  ADOQuery1.Open; //Generates error message

ERROR MESSAGE:
Project Datamanager.exe raised exception class EOleException with message
'Incompatible data type in the criteria expression'. Process stopped. Use
Step or Run to continue.

Whats wrong in the second query?

Complementary informations :
DOS_EMPR_PRENOM is Text type (visual Basic .mdb file)
DOS_ID is long integer type (visual Basic .mdb file)

Thanks for helping.



Relevant Pages

  • Cant access to numerial fields using adoquery ...
    ... I have posted this message before in several delphi news boards but never ... got any answer to resolve the problem. ... The following query works fine: ... ADOQuery1.Open; //Generates error message ...
    (comp.lang.pascal.delphi.misc)
  • Query to Access : doesnt see tables
    ... I choose the mdb file and so MS Query displays this error message ... "This data source does'nt have any visible table". ... I transfert my data to a new mdb file: it work's few times, ...
    (microsoft.public.excel)
  • Query to Access : doesnt see tables
    ... I choose the mdb file and so MS Query displays this error message ... "This data source does'nt have any visible table". ... I transfert my data to a new mdb file: it work's few times, ...
    (microsoft.public.access.queries)
  • Re: OutputTo to Excel question
    ... I can't help you with the macro error message as I don't use macros. ... the result from a query. ... Save a query that pulls the same data as the report. ...
    (microsoft.public.access.macros)
  • Re: Background Web Queries flaws!
    ... There is no way to trap errors on a background query. ... There is no way to control the timeout setting. ... The basic problem is that IE spits an error message before returning control ... > hard coded a 5 minute limit into the web query system. ...
    (microsoft.public.excel.programming)