[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how to add all fields to query programicaly?

Posted on 2004-10-26
4
Medium Priority
?
302 Views
Last Modified: 2012-05-05
i'm using this query:

AdoQuery1.SQL.Clear;
AdoQuery1.SQL.Add('select krupje, laikas, skirtumas, viso from chipsai where laikas > '+QuotedStr(DatetoStr(DateTimePicker1.Date - 1))+' order by laikas');
AdoQuery1.Open;

and i want to clear old field
and to add these fields to query programicaly like in fields editor
0
Comment
Question by:selas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 1500 total points
ID: 12411030
??
usual its done automatically after the open-method
you can force it with Dataset.FieldDef.Update;

just from head

meikl ;-)
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12411368
AdoQuery1.SQL.Active := False;
AdoQuery1.SQL.Text := 'select krupje, laikas, skirtumas, viso from chipsai where laikas > '+QuotedStr(DatetoStr(DateTimePicker1.Date - 1))+' order by laikas';
AdoQuery1.SQL.Active := True;

//....

Using:
AdoQuery1.SQL.Text := ....;
you clear whole old content and replace with new one
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12411772
If you have a problem with assigning the condition in the clause WHERE:
 .... WHERE LAIKAS > ' + QuotedStr(DatetoStr(DateTimePicker1.Date - 1)) ....

you may use a parameter:

AdoQuery1.SQL.Active := False;
AdoQuery1.SQL.Text := 'select krupje, laikas, skirtumas, viso from chipsai where LAIKAS > :PRM_LAIKAS order by laikas';
AdoQuery1.Parameters.ParamByName('PRM_LAIKAS').Value := TDateTime(DateTimePicker1.Date - 1);
AdoQuery1.SQL.Active := True;
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12411995
let
> AdoQuery1.SQL.Active := .... // True or False;
to be
   AdoQuery1.Active := .... // True or False;

sorry ....
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question