Problemas con Cadenas Largar de Fox a Sql

Hola amigo necesito insertar desde Visual Foxpro 9 a una Base de datos de Sql2000 Server pero cuando intento grabar la consulta se me cae. Te envío mi código que utilizo para que me ayudes por favor

=
TABLEUPDATE(.T.)
Wcadena1="
Insert Into Dat_Per(Gen_Per, Tdc_Per, Dni_Per, Ruc_Per, Dat_Per, Sex_Per, Civ_Per, Fna_Per, Reg_Per, Tel_Per,;
Cel_Per, Ema_Per, Cus_Per, Esa_Per, Dic_Per, Ndi_Per, Cad_Per, Con_Per, Fin_Per, Car_Per, Ubi_Per, Tur_Per,;
Tip_Per)
Values("+;
"(?
Thisform.Pageframe1.Page1.Gen_Per.Value, ?Thisform.Pageframe1.Page1.Tdc_Per.Value,;
?
Thisform.Pageframe1.Page1.Dni_Per.Value, ?Thisform.Pageframe1.Page1.Ruc_Per.Value, ?Thisform.Pageframe1.Page1.Dat_Per.Value+;
?
Thisform.Pageframe1.Page1.Sex_Per.Value, ?Thisform.Pageframe1.Page1.Civ_Per.Value, ?Thisform.Pageframe1.Page1.Fna_Per.Value,;
?
Thisform.Pageframe1.Page1.Reg_Per.Value, ?Thisform.Pageframe1.Page1.Tel_Per.Value, ?Thisform.Pageframe1.Page1.Cel_Per.Value,;
?
Thisform.Pageframe1.Page1.Ema_Per.Value, ?Thisform.Pageframe1.Page1.Cus_Per.Value, ?Thisform.Pageframe1.Page1.Esa_Per.Value,;
?
Thisform.Pageframe1.Page1.Dic_Per.Value, ?Thisform.Pageframe1.Page1.Ndi_Per.Value, ?Thisform.Pageframe1.Page1.Cad_Per.Value,;
?
Thisform.Pageframe1.Page1.Con_Per.Value, ?Thisform.Pageframe1.Page1.Fin_Per.Value, ?Thisform.Pageframe1.Page1.Car_Per.Value,;
?
Thisform.Pageframe1.Page1.Ubi_Per.Value, ?Thisform.Pageframe1.Page1.Tur_Per.Value, ?Thisform.Pageframe1.Page1.Tip_Per.Value)"
If Sqlexec
(CnxSap,Wcadena1)>0
Else
a=Aerror(Mat)
Messagebox(Mat(2),55,'Error al Grabar')
EndIf

de antemano mil gracias por tu Tiempo

1 Respuesta

Respuesta
1

Wuau gran código je je! Proba así

TABLEUPDATE(.T.)

Wcadena1="
Insert Into Dat_Per(Gen_Per, Tdc_Per, Dni_Per, Ruc_Per, Dat_Per, Sex_Per, Civ_Per, Fna_Per, Reg_Per, Tel_Per,;
Cel_Per, Ema_Per, Cus_Per, Esa_Per, Dic_Per, Ndi_Per, Cad_Per, Con_Per, Fin_Per, Car_Per, Ubi_Per, Tur_Per,;
Tip_Per)" + ;
Values(?
Thisform.Pageframe1.Page1.Gen_Per.Value, ?Thisform.Pageframe1.Page1.Tdc_Per.Value,;
?
Thisform.Pageframe1.Page1.Dni_Per.Value, ?Thisform.Pageframe1.Page1.Ruc_Per.Value, ?Thisform.Pageframe1.Page1.Dat_Per.Value+;
?
Thisform.Pageframe1.Page1.Sex_Per.Value, ?Thisform.Pageframe1.Page1.Civ_Per.Value, ?Thisform.Pageframe1.Page1.Fna_Per.Value,;
?
Thisform.Pageframe1.Page1.Reg_Per.Value, ?Thisform.Pageframe1.Page1.Tel_Per.Value, ?Thisform.Pageframe1.Page1.Cel_Per.Value,;
?
Thisform.Pageframe1.Page1.Ema_Per.Value, ?Thisform.Pageframe1.Page1.Cus_Per.Value, ?Thisform.Pageframe1.Page1.Esa_Per.Value,;
?
Thisform.Pageframe1.Page1.Dic_Per.Value, ?Thisform.Pageframe1.Page1.Ndi_Per.Value, ?Thisform.Pageframe1.Page1.Cad_Per.Value,;
?
Thisform.Pageframe1.Page1.Con_Per.Value, ?Thisform.Pageframe1.Page1.Fin_Per.Value, ?Thisform.Pageframe1.Page1.Car_Per.Value,;
?
Thisform. Pageframe1. Page1.Ubi_Per. ¿Value,? Thisform. Pageframe1. Page1.Tur_Per. ¿Value,? Thisform. Pageframe1. Page1.Tip_Per. Value)"

If Sqlexec
(CnxSap,Wcadena1)>0
Else
a=Aerror(Mat)
Messagebox(Mat(2), 55,'Error al Grabar')
EndIf

Estimado amigo Ahora me sale este error: "Falta ) en el nombre de la Función" y nuevo código es :

TABLEUPDATE
(.T.)
Wcadena1="
Insert Into Dat_Per(Gen_Per, Tdc_Per, Dni_Per, Ruc_Per, Dat_Per, Sex_Per, Civ_Per, Fna_Per, Reg_Per, Tel_Per,;
Cel_Per, Ema_Per, Cus_Per, Esa_Per, Dic_Per, Ndi_Per, Cad_Per, Con_Per, Fin_Per, Car_Per, Ubi_Per, Tur_Per,;
Tip_Per)" + ;
Values
(?Thisform.Pageframe1.Page1.Gen_Per.Value, ?Thisform.Pageframe1.Page1.Tdc_Per.Value,;
?
Thisform.Pageframe1.Page1.Dni_Per.Value, ?Thisform.Pageframe1.Page1.Ruc_Per.Value, ?Thisform.Pageframe1.Page1.Dat_Per.Value,;
?
Thisform.Pageframe1.Page1.Sex_Per.Value, ?Thisform.Pageframe1.Page1.Civ_Per.Value, ?Thisform.Pageframe1.Page1.Fna_Per.Value,;
?
Thisform.Pageframe1.Page1.Reg_Per.Value, ?Thisform.Pageframe1.Page1.Tel_Per.Value, ?Thisform.Pageframe1.Page1.Cel_Per.Value,;
?
Thisform.Pageframe1.Page1.Ema_Per.Value, ?Thisform.Pageframe1.Page1.Cus_Per.Value, ?Thisform.Pageframe1.Page1.Esa_Per.Value,;
?
Thisform.Pageframe1.Page1.Dic_Per.Value, ?Thisform.Pageframe1.Page1.Ndi_Per.Value, ?Thisform.Pageframe1.Page1.Cad_Per.Value,;
?
Thisform.Pageframe1.Page1.Con_Per.Value, ?Thisform.Pageframe1.Page1.Fin_Per.Value, ?Thisform.Pageframe1.Page1.Car_Per.Value,;
?
Thisform.Pageframe1.Page1.Ubi_Per.Value, ?Thisform.Pageframe1.Page1.Tur_Per.Value, ?Thisform.Pageframe1.Page1.Tip_Per.Value)"
If Sqlexec
(CnxSap,Wcadena1)>0
Else
a=
Aerror(Mat)
Messagebox
(Mat(2),55,'Error al Grabar')
EndIf

Ohh después del signo + coloca " (una comilla)

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas