Hi!
Don't use variable names like 'a', 'b' 'c' etc. They're recognized by VFP as a workareas - 'a' = workarea 1, 'b' = workarea 1 etc.
In addition, you can use aerror() function to get a details about what error happened and where (on sql server, odbc driver or just in VFP when processing '?' parameters).
HTH.
>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
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.