GARANTIR DESCONTO

Fórum erro com findkey #312730

11/02/2006

0

procedure TfrmEntradas.BtAlterarClick(Sender: TObject);
begin
glbCodigo:=´´;
Try
Application.CreateForm(TfrmConsEntradas,frmConsEntradas);
frmConsEntradas.showmodal;
Finally
frmConsEntradas.free;
end;
if glbNumero<>´´ then
Begin
Restaura;
Escolha:=´A´;
frmdm.adoVendas.BeginTrans;
tbProdutos.findkey([glbNumero]);
end
frmdm.qrEntradas.edit;
end;

[Error] untEntradas.pas(102): Undeclared identifier: ´findkey´

alguem sabe por que dar esse erro


Firekiller_am

Firekiller_am

Responder

Posts

11/02/2006

Aroldo Zanela

Colega,

Porque a classe do objeto instanciado não possui o método. Qual são os componentes de acesso a dados que está utilizando?


Responder

Gostei + 0

11/02/2006

Firekiller_am

adoconection, adoqurey mais nessa rotina nao posso porque
tbProdutos.findkey([glbNumero]);



nao sei como usar query


Responder

Gostei + 0

11/02/2006

Aroldo Zanela

Colega,

ADO não possui FindKey. No caso, pode substituir por Locate (Veja sintaxe no Help).


Responder

Gostei + 0

11/02/2006

Firekiller_am

ops sei usar sim mais nesse caso nao sei com fazer, como posso trocar

tbProdutos.findkey([glbNumero]); essa linha por algo na query..


Responder

Gostei + 0

11/02/2006

Firekiller_am

pode me dar um exemplo ?


Responder

Gostei + 0

11/02/2006

Aroldo Zanela

Colega,

Veja a dica e exemplo do Help:

Searches the dataset for a specified record and makes that record the current record. function Locate(const KeyFields: String; const KeyValues: Variant; Options: TLocateOptions): Boolean; override; Description Call Locate to search a dataset for a specific row and make it the current row. KeyFields is a string containing a semicolon-delimited list of field names on which to search. KeyValues is a variant that specifies the values to match in the key fields. If KeyFields lists a single field, KeyValues specifies the value for that field on the desired row. To specify multiple search values, pass a variant array as KeyValues, or construct a variant array on the fly using the VarArrayOf routine. For example: with ADOTable1 do Locate(´Company;Contact;Phone´, VarArrayOf([´Sight Diver´, ´P´, ´408-431-1000´]), [loPartialKey]); Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate allows partial-string matching on strings in KeyValues. If Options is an empty set, or if KeyFields does not include any string fields, Options is ignored. Locate returns True if it finds a matching row, and makes that row the current one. Otherwise Locate returns False.



Responder

Gostei + 0

11/02/2006

Firekiller_am

consegui resolver com cdsEntrada..

clientdataset

vc tem aguma apostila que fale os compoentes da paleta dbexpress


Responder

Gostei + 0

12/02/2006

Aroldo Zanela

Colega,

Veja logo acima, nos tópicos fixos.


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar