General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
First try to see what is the error:
?aerror(atemp) && is it more than 0?
?atemp[2] && please, post the result here, if it is not clear for you what to do next
>I have an ODBC Datos_ds with access driver for the database DATOS.MDB
>The code is :
>SET DATE british
>SET CPDIALOG OFF
>SET SAFETY OFF
>
>OPEN DATABASE DATOS1
>
>SELECT 1
>USE SOLICIT0
>
>SELECT 2
>USE CLIENTE0
>INDEX ON CUENTA TAG CUENTA
>SET ORDER TO TAG CUENTA
>
>
>SELECT 1
>GO TOP
>wmanejo = SQLCONNECT('Datos_ds','admin')
>
>DO WHILE .NOT. EOF()
> wfecha1 = DTOC(fecha_co)
> wfecha = fecha_co
> wanio = STR(YEAR(wfecha),4)
> wmes = wanio + "/"+RIGHT("0" + TRIM(STR(MONTH(wfecha),2)),2)
> wdia = wmes + "/" + RIGHT("0" + TRIM(STR(DAY(wfecha),2)),2)
> wsolicitud = solicitud
> woficial = referencia
> wcliente = cuenta
> wmoneda = moneda_co
> waprobado = cred_aprob
> wmonto = STR(importe_co,14,2)
> SELECT 2
> SEEK wcliente
> wrubro = rub_activ
> SELECT 1
> wcuotas = STR(cuo_tot_co,3,0)
> wcantidad = STR(1,1)
> =SQLPREPARE(wmanejo,'insert into datos (fecha,anio,mes,dia,solicitudes,oficial,cliente,moneda,aprobado,monto,rubro,cuotas,cantidad) values (wfecha1,wanio,wmes,wdia,wsolicitud,woficial,wcliente,wmoneda,waprobado,wmonto,wrubro,wcuotas,wcantidad)')
>resultado =SQLEXEC(wmanejo)
> =SQLCOMMIT(wmanejo)
> SKIP
>ENDDO
>=SQLDISCONNECT(wmanejo)
>CLOSE DATABASES
>CLOSE ALL
>RETURN
>
>The sqlexec return -1 to me always.
>Could you you help me ?
>Many Thanks
>Claudio Luna
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only