Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Bases de datos > Tablas planas
Register FAQ Members List Calendar Guía de estilo Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 17/06/2008
alexey1982's Avatar
alexey1982 alexey1982 is offline
Miembro
 
Join Date: Apr 2008
Location: mezzico
Posts: 15
Poder: 0
alexey1982 Va por buen camino
Unhappy Problema: record already locked by this session

hola, io de nuevo tengo un problema... hace poco comence a recibir un error en tiempo de ejecucion a la hora de querer hacer una busqueda incremental en una ttable.
mira uso una pagecontrol, en una pagina uso componentes standard, dbedit y un db navigator, y en la otra page, uso un DBGRID para mostrar la busqueda incremental.. el problema que me tiene loco!! (por que no modifique nada de ese codigo en especial) es QUE ME APARECE EL BENDITO MENSAJE DE " record already locked by this session " hasta ahora solo se que el error ocurre al invocar ""SETKEY"" de la tabla... pero.. no se como hacerle.. he intentado darle ttable.unlocktable(Tlreadlock,tlwritelock) y me sale con la jalada de que la tabla NO ESTA LOCKEADA... bueno si no esta lockeada entonces que eeeessssssssssssssssssssssss
una manita..... porfas!!

codigo:
Código Delphi [-]
 
procedure TClientemainf.SearchTagChange(Sender: TObject);
var txt, sfind:string;
    len:integer;
begin
 //don't do anything if user presses
 //delete or backspace
 if edFromCode = true then begin
   edFromCode := false;
   exit;
 end;
 //don't do anything if there is
 //no text in edSearch
 txt:=SEARCHTAG.Text;
 if Length(txt)=0 then exit;
 //goto nearest match
 with cliente_tb do begin
  try
  clientemainf.Cliente_tb.UnlockTable(LTrEADlOCK);
  CMD('Unlocking READ');
  clientemainf.Cliente_tb.UnlockTable(LTWriteLock);
  CMD('Unlocked Write');
  except
  on e: exception do cmd(e.Message);
  end;
   cmd('refresh');
   clientemainf.Cliente_tb.Refresh; <-- lo puse a ver si se quitaba el error pero no!!
    cmd('next setkey');
    clientemainf.Cliente_tb.SetKey;  <-----------WTF!!!
     // showmessage('setkey');
     cmd('setkey pass next fieldbyname');
   FieldByName(searchfield).AsString:=SEARCHTAG.text;
   showmessage('Set field forsearch');
   GotoNearest;
   showmessage('nearest');
 end;
 //calculate what part of text should be selected
 sfind := cliente_tb.FieldByName(searchfield).AsString;
 len := Length(sfind) - Length(txt);
 if len > 0 then begin
   edFromCode:=true;
   SEARCHTAG.Text:=sfind;
   SEARCHTAG.SelStart:=Length(txt);
   SEARCHTAG.SelLength:=len;
 end;
end;

Last edited by marcoszorrilla : 17/06/2008 at 13:47. Reason: Etiquetas Delphi
Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error "Record already locked by this session" karaoke Varios 5 13/12/2007 04:55
que es session.setAttribute cahosoft JAVA 1 04/08/2006 07:23
variant array is locked aig Providers 1 16/06/2006 23:24
Session!!!! acertij022 PHP 9 02/09/2004 15:11
variant or safe array is locked caio Firebird e Interbase 4 12/09/2003 18:33


All times are GMT +2. The time now is 21:38.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi