Fórum Conectando na DBGrid #180077
05/09/2003
0
with DtaObjetos do begin oCn.Connected := True; oCn.Open; with qryQuery do begin Active := True; Close; SQL.Clear; SQL.Add(´Select * from tblaluno where matricula = -1´); Open; ExecSQL; end; DtsGrid.DataSet := qryQuery; dbgAluno.DataSource := DtsGrid; //oCn.Close; //oCn.Connected := False; //qryQuery.Close; //qryQuery.Active := False; end;
Qd eu vou pesquisar eu faço assim mas dá erro.... o erro me informa q não aceita Multiplos registros.... o código tá assim:
if edtPesq.Text <> ´´ then begin with DtaObjetos do begin oCn.Close; oCn.Connected := False; oCn.Connected := True; oCn.Open; with qryQuery do begin Active := False; Active := True; Close; SQL.Clear; SQL.Add(´Select * from tblaluno where nome = "´+ edtPesq.Text +´"´); Open; ExecSQL; end; //DtsGrid.Free; //dbgAluno.Free; //DtsGrid.DataSet := qryQuery; //dbgAluno.DataSource := DtsGrid; //oCn.Close; //oCn.Connected := False; //qryQuery.Close; //qryQuery.Active := False; end; end else ShowMessage(´Por favor, digite algo´); edtPesq.SetFocus; end;
Como eu não posso me desconectar por causa da grid na primeira etapa eu fecho a conexão e o meu query nessa segunda etapa e tento realimentar a grid.... mas da erro no ´ExecSQL´.... Alguém sabe o q pode ser...?!
Brenerfa
Curtir tópico
+ 0Posts
05/09/2003
Biscoitorfa
Gostei + 0
05/09/2003
Brenerfa
Gostei + 0
05/09/2003
Brenerfa
ele diz q o dataset não suporta bookmark com multiplo rgistros nos controls
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)