FoxPro/Visual FoxPro - AGREGANDO REGISTRO EN RED

 
Vista:

AGREGANDO REGISTRO EN RED

Publicado por HELDER (COUNDY) (711 intervenciones) el 23/10/2009 17:43:08
HOLA AMIGOS PROGRAMADORES.

ESTOY INTENTANDO AGREGAR UN REGISTRO EN RED, MI SISTEMA LO TENGO INSTALADO EN DOS PCs, PC1 Y PC2.

LA BASE DE DATOS ESTA EN LA PC1 LA CUAL ES EL SERVER, Y DESE LA PC2 SOLO EJECUTO MI SISTEMA A TRAVES DE UN ACCESO DIRECTO QUE CREE DESDE LA PC1.

CUANDO ESTOY INTENTANDO AGREGAR O ALMACENAR UN REGISTRO A UNA TABLA, NO ME AGREGA NADA, TAMPOCO ME APARECE NADA EN EL GRID DEL FORM O NO ACTUALIZA EL GRID. Y LUEGO ME VOY AL SERVER Y NO HAY NADA DE REGISTRO AGREGADO.

EN QUE ESTARE FALLANDO, ESTE ES MI CODIGO.

cIdentidad = ALLTRIM(thisform.txtIdentidad.Value)
cNombre = ALLTRIM(thisform.txtNombre.Value)
cApellido = ALLTRIM(thisform.txtApellido.Value)
nSexo = thisform.opgSexo.Value
nTelefono = thisform.txtTelefono.Value
cDepartamento= ALLTRIM(thisform.cboDepartamento.DisplayValue)
cCod_depto = ALLTRIM(thisform.txtCod_depto.value)
cMunicipio = ALLTRIM(thisform.cboMunicipio.DisplayValue)
cCod_mun = ALLTRIM(thisform.txtCod_mun.Value)
cDomicilio = ALLTRIM(thisform.txtDomicilio.Value)
cEmpresa = ALLTRIM(thisform.cboEmpresa.DisplayValue)
cArea = ALLTRIM(thisform.cboArea.DisplayValue)
cCargo = ALLTRIM(thisform.cboCargo.DisplayValue)

m=MESSAGEBOX("¿Desea agregar los datos ahora?", 4+32+256, "Almacenando")
IF m = 6
SELECT tblEmpleados
APPEND BLANK
REPLACE identidad WITH cIdentidad;
nombre WITH cNombre;
apellido WITH cApellido
IF nSexo = 1
REPLACE sexo WITH "M"
ELSE
REPLACE sexo WITH "F"
ENDIF
REPLACE telefono WITH nTelefono;
departamento WITH UPPER(cDepartamento);
cod_depto WITH cCod_depto;
municipio WITH upper(cMunicipio);
cod_mun WITH cCod_mun;
domicilio WITH cDomicilio;
empresa WITH cEmpresa;
area WITH cArea;
cargo WITH cCargo
******
IF thisform.cboEmpresa.Style = 0
SELECT tblEmpresa
APPEND BLANK
REPLACE empresa WITH cEmpresa
ENDIF
IF thisform.cboArea.Style = 0
SELECT tblArea
APPEND BLANK
REPLACE area WITH cArea
ENDIF
IF thisform.cboCargo.Style = 0
SELECT tblCargo
APPEND BLANK
REPLACE cargo WITH cCargo
ENDIF
***
thisform.grdTblempleados.Click
thisform.Refresh
thisform.cmdLimpiar.Click
thisform.txtIdentidad.SetFocus
ELSE
m=MESSAGEBOX("Los datos no se fueron agregados", 0+64+0, "Acción cancelada")
ENDIF

SALUDOS DESDE -HONDURAS

HELDER
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:AGREGANDO REGISTRO EN RED

Publicado por alberto (404 intervenciones) el 23/10/2009 19:53:54
yo particularmente uso el inset into para agregar registros en sistemas en red , es mas seguro el comando sql

puedes hacer varias pruebas , despues del select tblEmpleados
prueba de hacer un browse para ver si tienes la bases de datos.
otra es despues de los replace yo uso flush que obliga a grabar los datos en el disco y despues dale un tableupdate()

este codigo lo tengo en un boton grabar en un formulario de ingreso de articulos , funciona de 10 en red, fíjate como grabo.

with thisform
if EMPTY(.TXTDESARTIC.VALUE)
messagebox("Existen espacios en blanco","Error")
.txtCODART.setfocus()
return
endif
select ARTICULO
set order to 1
go bottom
odi=articulo.CODART
append blank
Rlock()
repla codart with odi+1
repla unimedid with .txtunimedid.value
repla numprov with prove000.numprov
repla desprov with .combo1.value
repla desartic with .TXTdesartic.value
repla codint with .TXTcodint.value
repla p_lista with .txtp_lista.value
repla p_lista2 with .txtp_lista2.value
repla p_lista3 with .txtp_lista3.value
* repla preciomed with .txtpreciomed.value
repla numdpto with departamentos.numdpto
repla desdpto with .combo2.value
repla numru with rubros.codigo
repla desru with .combo3.value
repla p_costo with .txtp_costo.value
repla iva with .txtiva.value
repla iva2 with .txtiva2.value
repla iva3 with .txtiva3.value

repla ganancia with .txtganancia.value
repla ganancia2 with .txtganancia2.value
repla ganancia3 with .txtganancia3.value

repla exisal with .txtexisal.value
tableupdate(.t.)
flush //// aqui fuerzo a que se graben los datos
unlock all
THISFORM.RElease
return
endwith

SALUDOS Y ESPERO TENGAS SUERTE
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AGREGANDO REGISTRO EN RED

Publicado por hancito2003 (54 intervenciones) el 24/10/2009 00:32:01
No seria mas facil Mapear la pc1 con una unidad de letra, desde el icono de "My Network Places" en el escritorio?.

Tambien tuve ese problema una vez y de esta forma fue que lo resolvi. El asunto es que cree un acceso directo del ejecutable en la pc2, pero me conectaba a la pc1 atraves de una coneccion de red \\pc1\carpeta, y esto me daba problemas con la conexion con las bases de datos, asi que cree una ruta con una unidad en la red w:\carpeta, y eso resolvio todo mi problema solo con cambiar la forma de conexion desde windows.

Prueba a ver si el tuyo se resuelve igual sin necesidad de crear toda una rutina de programacion
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AGREGANDO REGISTRO EN RED

Publicado por alberto (404 intervenciones) el 24/10/2009 01:49:48
ESA OPCION DE HANCITO2003 ES LA CORRECTA PARA TRABAJAR EN RED, SE ME HABIA PASADO POR ALTO, GRACIAS AMIGO POR DARLE LA OPCION CORRECTA, LO IDEAL ES MAPEAR LA CARPETA O EL DISCO DEL SERVIDOR Y ENTRAR POR MI PC DESDE LA TERMINAL 1 A ESA UNIDAD DE RED EJ:
E:\TUCARPETA Y SELECCIONAR EL EJECUTABLE, DEBERIA ANDAR TODO BIEN.
SALUDOS A TODOS
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:AGREGANDO REGISTRO EN RED

Publicado por neo (1604 intervenciones) el 24/10/2009 17:00:06
Saludos Amigo Helder, hace tiempo que no enraba por aca.

Revisa esto:
http://www.lawebdelprogramador.com/news/mostrar_new.php?id=34&texto=FoxPro/Visual+FoxPro&n1=518381&n2=2&n3=0&n4=0&n5=0&n6=0&n7=0&n8=0&n9=0&n0=0

Si tienes mas dudas acerca de la cuestion en red. te paso un miniprograma de los que he realizado para que te des una idea de como trabajo en red.

Te voy a explicar de forma generalizada como trabajo en red:

1.- En el prg inicial tengo el codigo que te puse arriba.

2.- Ya con el codigo escrito que me mantendrá las tablas compartidas, ahora
lo que hago es compartir la carpeta donde está el software.

3.- Comparto la Carpeta y me aseguro que las pc´s terminales puedan accesar o abrir esta carpeta sin ningun problema (que se puedan utilizar los archivos)

4.- Para tener acceso total a esa carpeta, debes conectarte al server primero, para eso debes tener el mismo usuario tanto en el server como en las terminales.

Espero sea de ayuda. Cualquier cosa te ayudo con gusto.

Saludos y buen dia!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AGREGANDO REGISTRO EN RED

Publicado por HELDER (COUNDY) (711 intervenciones) el 24/10/2009 19:24:22
HOLA NEO Y TODOS LOS DEMAS, ESTUBE PROBANDO CON LO QUE ME DICEN PERO NO LOGRE SOLUCIONAR MI PROBLEMA.

NEO, CON LO QUE TU ME DICES ME ARRANCA BIEN EL SISTEMA, SOLO HAY UN PROBLEMA QUE CUANDO YA ESTOY ALMACENANDO UN REGISTRO ME DICE ESTE ERROR:
''CANNOT UPDATE THE CURSOR TBLCONTROL, SINCE IS READ ONLY''

DICE QUE NO SE PUDO ACTUALIZAR LA TABLA O CURSOR Y QUE ES DE SOLO LECTURA.

QUE ESTARA PASANDO ESTO ME SUCEDE PARA TODAS MIS TABLAS.

SALUDOS Y MUCHAS GRACIAS A TODOS.

SIGO ESPERANDO MAS IDEAS DE TODOS.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AGREGANDO REGISTRO EN RED

Publicado por alberto (404 intervenciones) el 24/10/2009 20:21:59
entra en mi pc , en la carpeta donde estan tus bases de datos , seleccionas todos los archivos y con el boton derecho ve a propiedades y sacale el tilde de solo lectura, es por eso que te envia el error.

saludos y cuenta como te fue.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AGREGANDO REGISTRO EN RED

Publicado por HELDER (COUNDY) (711 intervenciones) el 27/10/2009 16:05:16
Ya hice lo que me dices Alberto, pero aun sigue lo mismo.

Gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar