🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Problem with access database

#157
From: Patrick Wong
Date: Tue, 24 Apr 2007 03:49
26 lines
1610 bytes
"Daniel" <mzeng@eesensors.com> wrote in message 
news:455dedf8@newsgroups.borland.com...
>     ...
>     sql = "SELECT * FROM events WHERE started >= #11/12/2006# and started 
> <= #11/17/2006 11:56:32#";
>     ...
>     adoQuery->Open();
>     ...
>     Then I got error message, "Parameter object is improperly defined. 
> Inconsistent or incomplete information was provided.".
>

Hi,

I worked out a solution in creating two TDate objects,

TDate    dtFrom, dtTo;

Assign desired start and end times to these objects respectively, then 
construct the SQL statement in this manner:

sql = "SELECT * FROM events WHERE started between #";
sql += "dtFrom.DateTimeString() + "# and #" + dtTo.DateTimeString() + "#";

Hope this help 
Technical Details
Message-ID: <462d7e4c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <455dedf8@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,26d1ee675db50154
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Patrick Wong" <patrickwong@computer.org>
Newsgroups: borland.public.cppbuilder.database.ado
References: <455dedf8@newsgroups.borland.com>
Subject: Re: Problem with access database
Date: Tue, 24 Apr 2007 11:49:31 +0800
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 203.82.254.252
Message-ID: <462d7e4c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1177386572 203.82.254.252 (23 Apr 2007 20:49:32 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail