Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Problems with transference of data from vfp6.0 to SQL-SERVER
hello everybody
I have had problems with the transference of line information vfp 6,0 to SQL-SERVER 6,5.
I make connection ODBC, but when executing intruccion SQLEXEC this returns the value -1. aqui this the routine that I am using:
*******
Local Cconeccion
STORE SQLCONNECT('IndapCred','sa','') TO Cconeccion
IF Cconeccion <= 0
wait window " No se puede conectar, Error de conexión SQL"
return
ELSE
=SQLSETPROP(Cconeccion, 'transactions', 2)
endif
Local Commando,Contar,Tot,TotalRec
Local a,b,c,d,e,f,g
sele Usu_pred
Contar = 0
TotalRec = Reccount()
scan
a = rut_usua
b = rol_pred
c = cod_tene
d = hipoteca
e = iif(empty(ini_coar),ctod("01/01/1900"),ini_coar)
f = iif(empty(fin_coar),ctod("01/01/1900"),fin_coar)
g = estado_t
Commando="Insert into usuarios_predios(rut_usuario,rol_predio,cod_tenencia,hipotecado,inicio_contr_arr,fin_contr_arr,estado_traspaso) values (?a,?b,?c,?d,?e,?f,?g)"
if SQLEXEC(Cconeccion,Commando)<>-1
* lo traspasa
=SqlCommit(Cconeccion)
Contar = Contar + 1
else
=SQLrollback(Cconeccion)
* No lo Traspaso
sele errores
append blank
repla estado with "- Usuarios Predios:" +alltrim(a)
endif
sele usu_pred
endscan
=SQLDISCONNECT(Cconeccion)
*****
that I am making bad?
thanks
and
good bye
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement