🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #6098

Re: MS Access : 'Data type mismatch in criteria expression'

#6098
From: PS
Date: Tue, 01 Aug 2000 00:00
28 lines
1908 bytes
I have done some experimenting and if I set the Parameter DataType each time
instead of once when the query is set up then it fixes the problem. Why is
my query losing it's parameter data on Access DB's?

"PS" <paul@nospam.stables1.freeserve.co.uk> wrote in message
news:8m63pr$29f$1@newsreaderg1.core.theplanet.net...
> I am using an ADO connection to an Access DB.
> I have a TADOQuery along the lines of:
>
> UPDATE Engineers SET Available = :LOGON, LastLogonOff = :TIMESTAMP WHERE
> EngineerID = :_SOURCE
>
> Where Engineers table fields are Available = Yes/No (True/False),
> LastLogonOff = Date/Time and EngineerID = Text.
>
> The parameter data is set to 'bool', 'TDateTime' and 'AnsiString' using a
> Variant type.
>
> The first time the query is run, it works fine.
> The second time the query is run I get a 'Data type mismatch in criteria
> expression' error.
>
> The same code works fine into a SQL 7 database of a similar structure.
>
> Thanks in advance,
> Paul Stables.
>
>
Technical Details
Message-ID: <8m6869$49j$1@newsreaderg1.core.theplanet.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8m63pr$29f$1@newsreaderg1.core.theplanet.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5cad,fc570e8491be657c
X-Google-Attributes: gidf5cad,public
X-Google-Thread: 10698b,fc570e8491be657c
X-Google-Attributes: gid10698b,public
From: "PS" <paul@nospam.stables1.freeserve.co.uk>
Subject: Re: MS Access : 'Data type mismatch in criteria expression'
Date: 2000/08/01
Message-ID: <8m6869$49j$1@newsreaderg1.core.theplanet.net>
X-Deja-AN: 653148287
References: <8m63pr$29f$1@newsreaderg1.core.theplanet.net>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
X-Complaints-To: abuse@theplanet.net
X-Trace: newsreaderg1.core.theplanet.net 965125129 4403 195.92.39.67 (1 Aug 2000 10:18:49 GMT)
Organization: Customer of Energis Squared
X-MSMail-Priority: Normal
NNTP-Posting-Date: 1 Aug 2000 10:18:49 GMT
Newsgroups: borland.public.cppbuilder.database.ado,borland.public.delphi.database.ado