Fórum Montar selct #286860
04/07/2005
0
eu to tentando algo desse tipo, mas sei q estah errado
aos pouco vou aprimorar esse select tipo conferir a data de vencimento, a situacao dele, c o aluno ainda continua na academia ou jah trancou a matricula
select
CODIGO, NOMECLI
from
CLIENTE
where
if (:edcodigo.text = codigo)
{lbsituacao:= ´liberado´ }
else
(lbsituacao:= ´codigo inexistente´)
obrigo pessoal
$grandaum$
Curtir tópico
+ 0Posts
04/07/2005
Sremulador
Gostei + 0
04/07/2005
$grandaum$
Gostei + 0
04/07/2005
Rjun
Query1.SQL.Clear; Query1.SQL.Add(´select CODIGO, NOMECLI from CLIENTE where CODIGO = :Codigo´); Query1.Parameters.ParamByName(´Codigo´).Value = edtCodigo.Text; Query1.Open; try if Query1.IsEmpty then lblsituacao.Caption := ´Acesso liberado´ else lblsituacao.Caption := ´Código não encontrado.´; finally Query1.Close; end;
Gostei + 0
04/07/2005
Ivanh
with TSQLQuery.Create(nil) do
begin
try
SQLConnection := SuaConexao;
SQL.Clear;
SQL.Add(Format(´SELECT ETC... WHERE CODIGO = ¬s´,[Edit1.Text]));
Open;
if not Fields[0].IsNull then
begin
label1.caption := ´Achou´;
end
else
begin
label1.caption := ´Ñ Achou´;
end;
finally
Close;
Free;
end;
end;
Gostei + 0
04/07/2005
$grandaum$
Gostei + 0
04/07/2005
$grandaum$
Deixa eu reescrever tudu issu aki
eu uso o SqlConnection pra fazer conexao com o bd e uso o SqlDataSet pra fazer conexao com as tabelas.....pronto agora melhorou
Gostei + 0
04/07/2005
Ivanh
with TSQLQuery.Create(nil) do begin try SQLConnection := ; SQL.Clear; SQL.Add(´´); SQL.Add(´´); Open; if not Fields[0].IsNull then begin end; finally Close; Free; end; end;
Faz assim que funciona!
Gostei + 0
04/07/2005
$grandaum$
Query1.SQL.Clear; Query1.SQL.Add(´select CODIGO, NOMECLI from CLIENTE where CODIGO = :Codigo´); Query1.Parameters.ParamByName(´Codigo´).Value = edtCodigo.Text; Query1.Open; try if Query1.IsEmpty then lblsituacao.Caption := ´Acesso liberado´ else lblsituacao.Caption := ´Código não encontrado.´; finally Query1.Close; end;
ele dah erro na 3º linha no Parameters
Gostei + 0
04/07/2005
$grandaum$
with TSQLQuery.Create(nil) do begin try SQLConnection := ; SQL.Clear; SQL.Add(´´); SQL.Add(´´); Open; if not Fields[0].IsNull then begin end; finally Close; Free; end; end;
ocorre o seguinte erro
[Error] UnitPrincipal.pas(157): Incompatible types: ´TSQLConnection´ and ´String´
Gostei + 0
04/07/2005
$grandaum$
with TSQLQuery.Create(nil) do begin try SQLConnection := ; SQL.Clear; SQL.Add(´´); SQL.Add(´´); Open; if not Fields[0].IsNull then begin end; finally Close; Free; end; end;
ocorre o seguinte erro
[Error] UnitPrincipal.pas(157): Incompatible types: ´TSQLConnection´ and ´String´[/quote:8cd19e3993]
e tb oq viria dentro do Sql.add(´ ´);
Gostei + 0
05/07/2005
Sremulador
o cod para a pesquisa da tabela
o locate fica assim
tabela.locate (´CAMPO DA TABELA´, campo a variavel a pesquisar, [...])
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)