Article View: borland.public.cppbuilder.database.ado
Article #2401Re: Question about ADO and Access
From: Viatcheslav V. Vassiliev
Date: Tue, 15 Jul 2003 15:54
Date: Tue, 15 Jul 2003 15:54
42 lines
2477 bytes
2477 bytes
AND ([DateTime] >= #07/15/2002 00:00:00#)
always in US format = #mm/dd/yyyy hh:nn:ss#
Also may VBScript functions are usuable
AND ([DateTime] < DateSerial(2003, 07, 16) + TimeSerial(00, 00, 00)
< DateSerial(2003, 07, 16) is better in your case than <= DateSerial(2003,
07, 15) + TimeSerial(23, 59, 59) because it includes 2003/07/15 23:59:59.5
Note brackets around DateTime - it is very likely the keyword.
----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (through OLEDB) databases.
"afatdog" <afatdog.hn@yeah.net> �������/�������� � �������� ���������:
news:3f14100d@newsgroups.borland.com...
> I use TADOConnection to connect a database, Access 2000.
>
> ADOQuery->SQL->Add("select");
> ADOQuery->SQL->Add(" *");
> ADOQuery->SQL->Add("from");
> ADOQuery->SQL->Add(" T_XXXX");
> ADOQuery->SQL->Add("where");
> ADOQuery->SQL->Add(" (.....)");
> ADOQuery->SQL->Add(" AND (DateTime >= #2002-07-15 00:00:00#)"); // here
> ADOQuery->SQL->Add(" AND (DateTime <= #2003-07-15 23:59:59#)"); // here
> ADOQuery->Open();
>
> There is some exception was throw : "Parameter object is improperly
defined.
> Inconsistent or incomplete information was provided".
> But this SQL can be correct execute in Access.
> Where is wrong?
>
>
>
Technical Details
Message-ID:
<3f1424ad@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f14100d@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,f6df55237653b6e2 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-07-15 09:12:07 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3f14100d@newsgroups.borland.com> Subject: Re: Question about ADO and Access Date: Tue, 15 Jul 2003 19:54:18 +0400 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 213.247.201.57 Message-ID: <3f1424ad@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1058284717 213.247.201.57 (15 Jul 2003 08:58:37 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail