Silly question

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jalin
Posts: 23
Joined: Tue 18 Mar 2008 14:45

Silly question

Post by jalin » Tue 20 May 2008 14:18

I have a very simple query:

select count(*) from departamento

How can I get the result of the query with the MyDac component ?

Thanks and sorry
Jalin

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Re: Silly question

Post by eduardosic » Tue 20 May 2008 22:57

jalin wrote:I have a very simple query:

select count(*) from departamento

How can I get the result of the query with the MyDac component ?

Thanks and sorry
Jalin
try this

Code: Select all

//QryCount is a TMyQuery
//nValue is Variable to receive the value os query..
With QryCount do begin
 Close;
 Sql.Text := 'select count(*) as New  from departamento';
 Execute;
 nValue := FieldByName( 'New' ).AsInteger;
 Close;
end;

jalin
Posts: 23
Joined: Tue 18 Mar 2008 14:45

Post by jalin » Wed 21 May 2008 12:57

I tried but doesnt work

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Wed 21 May 2008 15:48

jalin wrote:I tried but doesnt work
what problem? what erros messages? send a small project to CoreLab team.

You are a New user? please See MyDAC demo.

Post Reply