retorno de valores
tenho uma tabela..preciso saber quantos registros tem na tabela
tentei:
q.clear;
q.sql.add(´select count(*) as total from tabela´);
q.execsql;
total = q.FieldByName(´total´).AsInteger;
label1.caption:=total;
nao funciona,......alguem sabe como posso fazer isso ??
Grata!
tentei:
q.clear;
q.sql.add(´select count(*) as total from tabela´);
q.execsql;
total = q.FieldByName(´total´).AsInteger;
label1.caption:=total;
nao funciona,......alguem sabe como posso fazer isso ??
Grata!
Karolina
Curtidas 0
Respostas
Luciano Pimenta®
22/09/2003
qual o tipo da variavel total ? Se for integer tem que transformar em string.
label1.caption:= IntToStr(Total);
label1.caption:= IntToStr(Total);
GOSTEI 0
Marcelo.c
22/09/2003
Experimente:
q.clear;
q.Close;
q.sql.add(´select count(*) as total from tabela´);
q.[b:10663dbb66]Open[/b:10663dbb66];
label1.caption:=inttostr(q.FieldByName(´total´).AsInteger);
q.clear;
q.Close;
q.sql.add(´select count(*) as total from tabela´);
q.[b:10663dbb66]Open[/b:10663dbb66];
label1.caption:=inttostr(q.FieldByName(´total´).AsInteger);
GOSTEI 0
Karolina
22/09/2003
tenho uma tabela..preciso saber quantos registros tem na tabela
tentei:
q.clear;
q.sql.add(´select count(*) as total from tabela´);
q.execsql;
total = q.FieldByName(´total´).AsInteger;
label1.caption:=total;
nao funciona,......alguem sabe como posso fazer isso ??
Grata!
PESSOAL! VALEW! ....funcionou.....muito obrigada
GOSTEI 0