Error al reabrir formulario
TEngo un error al reabrir un formulario, osea si lo abro x segunda ves me genera un error llamando ALIAS NAME IS ALREADY IN USE algo como q el alias q necesita leerse ya esta en uso. Diganme como puedo cerrar un alias.
Este es el codigo del evento INIT del formulario
THISFORM.Caption=\\\\\\\"O/T PENDIENTES DE AUTORIZACION - \\\\\\\"+nivel
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\mp\\\\\\\\mp_cabot05.Dbf Again Alias mpcab Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\mp\\\\\\\\mp_ot05.Dbf Again Alias mpot Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\mp\\\\\\\\mp_signat05.Dbf Again Alias mpau Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\rb\\\\\\\\rb_cabot05.Dbf Again Alias rbcab Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\rb\\\\\\\\rb_ot05.Dbf Again Alias rbot Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\rb\\\\\\\\rb_signat05.Dbf Again Alias rbau Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\ms\\\\\\\\ms_cabot05.Dbf Again Alias mscab Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\ms\\\\\\\\ms_ot05.Dbf Again Alias msot Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\ms\\\\\\\\ms_signat05.Dbf Again Alias msau Shared
Select ottemp
Delete All
Append From Dbf(\\\\\\\\'mpot\\\\\\\\')
Append From Dbf(\\\\\\\\'rbot\\\\\\\\')
Append From Dbf(\\\\\\\\'msot\\\\\\\\')
Select tempauto
Delete All
Append From Dbf(\\\\\\\\'mpau\\\\\\\\')
Append From Dbf(\\\\\\\\'rbau\\\\\\\\')
Append From Dbf(\\\\\\\\'msau\\\\\\\\')
Select cabtemp
Delete All
Append From Dbf(\\\\\\\\'mpcab\\\\\\\\')
Append From Dbf(\\\\\\\\'rbcab\\\\\\\\')
Append From Dbf(\\\\\\\\'mscab\\\\\\\\')
Select mpcab
Use
Select rbcab
Use
Select mscab
Use
Select mpot
Use
Select rbot
Use
Select msot
Use
Select cabtemp
SET FILTER TO tempauto.&var1=\\\\\\\\' \\\\\\\\'
*Set Filter To tempauto.ggen=\\\\\\\\' \\\\\\\\'
Go Top
Thisform.grid1.Refresh
Thisform.grid1.SetFocus
Thisform.grid2.Refresh
y este es el codigo del evento RELEASE
Select tempauto
GO top
Do While !Eof()
Replace (var1) With tempauto.&var1,;
(var2) With tempauto.&var2 For id_ot=tempauto.id_ot In mpau
Replace (var1) With tempauto.&var1,;
(var2) With tempauto.&var2 For id_ot=tempauto.id_ot In rbau
Replace (var1) With tempauto.&var1,;
(var2) With tempauto.&var2 For id_ot=tempauto.id_ot In msau
skip
ENDDO
SELECT mpau
use
SELECT rbau
USE
SELECT msau
USE
SELECT tempauto
SET FILTER TO
DELETE all
SELECT cabtemp
SET FILTER TO
DELETE all
SELECT ottemp
DELETE ALL
De antemano gracias x su ayuda...
Este es el codigo del evento INIT del formulario
THISFORM.Caption=\\\\\\\"O/T PENDIENTES DE AUTORIZACION - \\\\\\\"+nivel
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\mp\\\\\\\\mp_cabot05.Dbf Again Alias mpcab Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\mp\\\\\\\\mp_ot05.Dbf Again Alias mpot Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\mp\\\\\\\\mp_signat05.Dbf Again Alias mpau Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\rb\\\\\\\\rb_cabot05.Dbf Again Alias rbcab Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\rb\\\\\\\\rb_ot05.Dbf Again Alias rbot Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\rb\\\\\\\\rb_signat05.Dbf Again Alias rbau Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\ms\\\\\\\\ms_cabot05.Dbf Again Alias mscab Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\ms\\\\\\\\ms_ot05.Dbf Again Alias msot Shared
Select 0
Use c:\\\\\\\\ot\\\\\\\\Tables\\\\\\\\ms\\\\\\\\ms_signat05.Dbf Again Alias msau Shared
Select ottemp
Delete All
Append From Dbf(\\\\\\\\'mpot\\\\\\\\')
Append From Dbf(\\\\\\\\'rbot\\\\\\\\')
Append From Dbf(\\\\\\\\'msot\\\\\\\\')
Select tempauto
Delete All
Append From Dbf(\\\\\\\\'mpau\\\\\\\\')
Append From Dbf(\\\\\\\\'rbau\\\\\\\\')
Append From Dbf(\\\\\\\\'msau\\\\\\\\')
Select cabtemp
Delete All
Append From Dbf(\\\\\\\\'mpcab\\\\\\\\')
Append From Dbf(\\\\\\\\'rbcab\\\\\\\\')
Append From Dbf(\\\\\\\\'mscab\\\\\\\\')
Select mpcab
Use
Select rbcab
Use
Select mscab
Use
Select mpot
Use
Select rbot
Use
Select msot
Use
Select cabtemp
SET FILTER TO tempauto.&var1=\\\\\\\\' \\\\\\\\'
*Set Filter To tempauto.ggen=\\\\\\\\' \\\\\\\\'
Go Top
Thisform.grid1.Refresh
Thisform.grid1.SetFocus
Thisform.grid2.Refresh
y este es el codigo del evento RELEASE
Select tempauto
GO top
Do While !Eof()
Replace (var1) With tempauto.&var1,;
(var2) With tempauto.&var2 For id_ot=tempauto.id_ot In mpau
Replace (var1) With tempauto.&var1,;
(var2) With tempauto.&var2 For id_ot=tempauto.id_ot In rbau
Replace (var1) With tempauto.&var1,;
(var2) With tempauto.&var2 For id_ot=tempauto.id_ot In msau
skip
ENDDO
SELECT mpau
use
SELECT rbau
USE
SELECT msau
USE
SELECT tempauto
SET FILTER TO
DELETE all
SELECT cabtemp
SET FILTER TO
DELETE all
SELECT ottemp
DELETE ALL
De antemano gracias x su ayuda...
Colega:
Prueba con CLOSE TABLES en el evento DESTROY del formulario.
Saludos cordiales.
Gabriel Dameñov
www.gdmsargentina.com.ar
Prueba con CLOSE TABLES en el evento DESTROY del formulario.
Saludos cordiales.
Gabriel Dameñov
www.gdmsargentina.com.ar
te recomendaria que uses la sentencia If Used(table) para validar cada una de tus tablas
Saludos !
Silverio Ayala
Saludos !
Silverio Ayala
Que tal.
Si estas usando formularios no te deberia causar ningun problema ya que cada ves que un usuario abre el formulario , crea un entorno individual para cada terminal o usuario, bueno por que no pruebas usar la DATRA ENVIROMENT que te proporciona el formulario yq que esta genera un codigo el cual ya no tienes que manipular y el cual abre y cierra las tablas sin ningun problea, te ahorrarias el estar utilizando la sentencias USE XXX.
SI NO TE RECOMIENDO QUE UTILIZES EL WIZARD.
con gusto te ayudaria a elaborar las rutinas mi correo es : [email protected], solo mandalas a mi correo y con gusto te echo la mano y te las regreso. OK
Si estas usando formularios no te deberia causar ningun problema ya que cada ves que un usuario abre el formulario , crea un entorno individual para cada terminal o usuario, bueno por que no pruebas usar la DATRA ENVIROMENT que te proporciona el formulario yq que esta genera un codigo el cual ya no tienes que manipular y el cual abre y cierra las tablas sin ningun problea, te ahorrarias el estar utilizando la sentencias USE XXX.
SI NO TE RECOMIENDO QUE UTILIZES EL WIZARD.
con gusto te ayudaria a elaborar las rutinas mi correo es : [email protected], solo mandalas a mi correo y con gusto te echo la mano y te las regreso. OK
