Article View: borland.public.cppbuilder.database.ado
Article #1605Re: Flexible SQL Queries through ADO.
From: Mark Guerrieri
Date: Mon, 31 May 2004 03:15
Date: Mon, 31 May 2004 03:15
23 lines
1574 bytes
1574 bytes
>
> AnsiString DynamicFlexSQLStmt = "SELECT Date " + ""... (Whatever I add for
Column Selections)
>
> I cannont use TADOQuery1->SQL->Add(":MyFlexibleSQLStmt");
> TADOQuery1->SQL->Parameters->ParamByName("MyFlexibleSQLStmt")->Value =
DynamicFlexSQLStmt;
>
Try this-
AnsiString DynamicFlexSQLStmt = "SELECT Date " + ""... (Whatever I add for
Column Selections)
TADOQuery1->SQL->Text = DynamicFlexSQLStmt;
I do this all the time and it works fine. I don't bother with parameters,
I just build the values right into the SQL statement. If you need
parameters, add this:
TADOQuery1->Parameters->ParseSQL(DynamicFlexSQLStmt, true);
TADOQuery1->Parameters->ParamByName("ParamName")->Value = ParamValue;
Mark
Technical Details
Message-ID:
<40baa32b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40ba50b3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,88aab88ffc95b09 X-Google-Attributes: gid10698b,public From: "Mark Guerrieri" <markg11@comcast.net> Newsgroups: borland.public.cppbuilder.database.ado References: <40ba50b3$1@newsgroups.borland.com> Subject: Re: Flexible SQL Queries through ADO. Date: Sun, 30 May 2004 23:15:02 -0400 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.39.161.71 Message-ID: <40baa32b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1085973291 68.39.161.71 (30 May 2004 20:14:51 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail