C++ Builder

Moderators: Lundin
Number of threads: 509
Number of posts: 1146

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
tquery query by field Posted by zuzito76 on 28 Mar 2011 at 3:16 AM
Hello friends. I´m from Spain and here i´m trying a project using c++ builder compiler , but i´ve a little problem using a tquery object. I mean:
We can supose we´ve got a table (created by Database Desktop) named simply "Men" with three fields: first field name "Number_Id" , Second field named , "First_Name" , and a third field named "Last_Name". Ok , but i can´t select only a field making the query.This is the problem. Making this:

Query1->Close();
Query1->SQL->Clear();
Query1->SQL->Add("SELECT Men.Number_Id FROM Men.db");
Query1->Open();
I get this error Message: "Field 'First_Name' Not Found"

If The query is this:
Query1->SQL->Add("SELECT Men.Number_Id , First_Name FROM Men.db");
I get this error Message: "Field 'Last_Name' Not Found"

It´s the same if i don´t select Number_Id in the query.

If i select all in the query ,( i mean:"SELECT Men.Number_Id , First_Name , Last_Name , FROM Men.db" or is the same: "SELECT * FROM Men.db") is all right , all OK.
So...i can´t select only a field in the query. WHY?? . Any help please?

Thanx





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.