CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Mar 2011
    Location
    Greece
    Posts
    26

    c++ builder 2007, query count record from database

    Goodmorning

    I have a simple application on C++Builder2007 and access 2007. I want to make a query so when a user hits a button to count the records on a specifiec date. I wrote the above but its not right. I want little help.
    The fields are DATE->Date/Time Type... When i hit the button it says invalid integer.. I try to used the ADODATASET component but i dont have problem with that. Can i use something else;;;Like ADOQUERY. Wich is faster?

    ADODataSet1->Active=false;
    AnsiString query;
    int MaxRecords=0;
    query="SELECT Count (DATE) FROM DEYAS WHERE DATE= '" + Edit14->Text + "'";
    ADODataSet1->CommandText="SELECT COUNT (DATE) FROM BILLS WHERE DATE= '" + Edit14->Text + "'" ;

    ADODataSet1->Active=true;
    Edit17->Text=IntToStr(MaxRecords);
    Last edited by Leite333; October 18th, 2012 at 01:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured