Article View: borland.public.cppbuilder.database.ado
Article #1361Re: Data Type Mismatch in Criteria Expression
From: Kim Utley
Date: Mon, 26 Jul 2004 19:30
Date: Mon, 26 Jul 2004 19:30
63 lines
2814 bytes
2814 bytes
Am using Microsoft Access with TADOQuery and TADOConnection.
What do you mean by 'use parameter'?
I wish to to SQL statement because if I use TADOTable it wants to read up
all columns when I open the table.
adoQuery->SQL->Clear();
adoQuery->SQL->Add( "DELETE FROM EventHistoryTbl WHERE
DateTimeStamp < '06/26/04 10:17:30'" );
// this is where the exception is thrown...
//
adoQuery->ExecSQL();
Kindest Regards,
Kim
"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:41053e2f$1@newsgroups.borland.com...
> It depends on DBMS. General solution that should work with any DBMS is to
> use parameter for dates.
>
> //------------------------------------------
> Regards,
> Vassiliev V. V.
> http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> ADO.Net
> http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> MS Jet (Access) and Interbase (through OLEDB)
>
> "Kim Utley" <kim@simsware.com> �������/�������� � �������� ���������:
> news:41052c3f$1@newsgroups.borland.com...
> > Hi All,
> >
> > Am working on BCB 6 with TADO... objects, specifically TADOConnection
and
> > TADOQuery in my example problem. I am attempting to delete all rows in a
> > table that have a date/time stamp older than 'x' amount of days.
> >
> > I am issuing the following SQL statement be am getting "Data type
mismatch
> > in criteria express' exception:
> >
> > DELETE FROM EventHistoryTbl WHERE DateTimeStamp < '06/26/04 10:17:30'
> >
> > I've also tried:
> >
> > DELETE FROM EventHistoryTbl WHERE DateTimeStamp < #06/26/04 10:17:30#
> >
> > Does anyone know why I'm getting this error?
> >
> > Kindest Regards,
> >
> >
> > Kim L. Utley
> >
> >
>
>
Technical Details
Message-ID:
<41055bb8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41052c3f$1@newsgroups.borland.com> <41053e2f$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,8373fe4b7c83316d X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Kim Utley" <kim@simsware.com> Newsgroups: borland.public.cppbuilder.database.ado References: <41052c3f$1@newsgroups.borland.com> <41053e2f$1@newsgroups.borland.com> Subject: Re: Data Type Mismatch in Criteria Expression Date: Mon, 26 Jul 2004 14:30:04 -0500 Lines: 65 Organization: SIMS, Inc. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 65.205.74.2 Message-ID: <41055bb8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1090870200 65.205.74.2 (26 Jul 2004 12:30:00 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail