sigue lento
Publicado por jose leo (137 intervenciones) el 28/10/2008 03:15:00
Holas, mi consulta sigue lento es una facturacion k busca registros (15000) en multiusuario, pero para presentar la consulta la primera vez es lento, despues si lo vuelvo a llamar ya esta bien, pero si cierro el form y lo ejecuto de nuevo otra vez se vuelve lento dejo el codigo porfa a ver si alguien me ayuda
En el Interactivechange de un textbox
LPARAMETERS nKeyCode, nShiftAltCtrl
**si Persona Natural o Juridica (Diferentes tablas)
IF Thisform.combo1.value="Natural"
SELECT Pnatural
SET ORDER TO Nombre
ELSE
SELECT Pjuridica
SET ORDER TO Nombre
ENDIF
IF nkeycode=13
IF Thisform.combo1.value="Natural"
SELECT Pnatural.nombre,Pnatural.idcontratante,Pnatural.direccion,Pnatural.ruc,Pnatural.dni ;
from Pnatural WHERE (LEFT(ALLTRIM(nombre), LEN(ALLTRIM(THISFORM.Txtcliente.VALUE))) = LEFT(ALLTRIM(THISFORM.Txtcliente.VALUE), LEN(THISFORM.Txtcliente.VALUE)));
ORDER BY Nombre INTO CURSOR cursornatural
**Aqui muestro un form con los registros solicitados
**es donde se demora en presentar el browse con los registros
Do Form Muestrapnaturalcaja
ELSE
SELECT Pjuridica.nombre,Pjuridica.idcontratante,Pjuridica.direccion,Pjuridica.ruc,Pjuridica.dni ;
from Pjuridica WHERE (LEFT(ALLTRIM(nombre), LEN(ALLTRIM(THISFORM.Txtcliente.VALUE))) = LEFT(ALLTRIM(THISFORM.Txtcliente.VALUE), LEN(THISFORM.Txtcliente.VALUE)));
ORDER BY Nombre INTO CURSOR cursorjuridica
Do Form Muestrapjuridicacaja
ENDIF
Thisform.txtcodigo.Value=Kcodigo
Thisform.txtcliente.Value=knombre
IF EMPTY(Thisform.txtcodigo.Value)
Thisform.combo2.displayvalue=""
Thisform.txtfaccodigo.Value=""
Thisform.txtfaccliente.value=""
Thisform.txtruc.Value=""
Thisform.txtdireccion.Value=""
Thisform.txtdni.Value=""
Thisform.combo1.setfocus
ELSE
Thisform.combo2.DisplayValue=Thisform.combo1.value
Thisform.txtfaccodigo.Value=Kcodigo
Thisform.txtfaccliente.value=Knombre
Thisform.txtruc.Value=kruc
Thisform.txtdireccion.Value=kdireccion
Thisform.txtdni.Value=kdni
ENDIF
Thisform.cmdactualiza.Enabled=.T.
Thisform.txtfaccliente.setfocus
ENDIF
En el Interactivechange de un textbox
LPARAMETERS nKeyCode, nShiftAltCtrl
**si Persona Natural o Juridica (Diferentes tablas)
IF Thisform.combo1.value="Natural"
SELECT Pnatural
SET ORDER TO Nombre
ELSE
SELECT Pjuridica
SET ORDER TO Nombre
ENDIF
IF nkeycode=13
IF Thisform.combo1.value="Natural"
SELECT Pnatural.nombre,Pnatural.idcontratante,Pnatural.direccion,Pnatural.ruc,Pnatural.dni ;
from Pnatural WHERE (LEFT(ALLTRIM(nombre), LEN(ALLTRIM(THISFORM.Txtcliente.VALUE))) = LEFT(ALLTRIM(THISFORM.Txtcliente.VALUE), LEN(THISFORM.Txtcliente.VALUE)));
ORDER BY Nombre INTO CURSOR cursornatural
**Aqui muestro un form con los registros solicitados
**es donde se demora en presentar el browse con los registros
Do Form Muestrapnaturalcaja
ELSE
SELECT Pjuridica.nombre,Pjuridica.idcontratante,Pjuridica.direccion,Pjuridica.ruc,Pjuridica.dni ;
from Pjuridica WHERE (LEFT(ALLTRIM(nombre), LEN(ALLTRIM(THISFORM.Txtcliente.VALUE))) = LEFT(ALLTRIM(THISFORM.Txtcliente.VALUE), LEN(THISFORM.Txtcliente.VALUE)));
ORDER BY Nombre INTO CURSOR cursorjuridica
Do Form Muestrapjuridicacaja
ENDIF
Thisform.txtcodigo.Value=Kcodigo
Thisform.txtcliente.Value=knombre
IF EMPTY(Thisform.txtcodigo.Value)
Thisform.combo2.displayvalue=""
Thisform.txtfaccodigo.Value=""
Thisform.txtfaccliente.value=""
Thisform.txtruc.Value=""
Thisform.txtdireccion.Value=""
Thisform.txtdni.Value=""
Thisform.combo1.setfocus
ELSE
Thisform.combo2.DisplayValue=Thisform.combo1.value
Thisform.txtfaccodigo.Value=Kcodigo
Thisform.txtfaccliente.value=Knombre
Thisform.txtruc.Value=kruc
Thisform.txtdireccion.Value=kdireccion
Thisform.txtdni.Value=kdni
ENDIF
Thisform.cmdactualiza.Enabled=.T.
Thisform.txtfaccliente.setfocus
ENDIF
Valora esta pregunta


0