Hola, tengo este programa y no entiendo porque me da error el segundo insert:
#include "FiveWin.ch"
REQUEST HB_LANG_ES
function Main()
local oCn, oCnM, oRs, aStates
LOCAL lShowError := .t.
/*
dbcreate( ".\prudbt", { { "id" , "n", 8, 0 }, ;
{ "Cliente " , "n", 6, 0 }, ;
{ "Numero" , "n", 6, 0 }, ;
{ "Numero " , "n", 6, 0 }, ;
{ "Lider " , "n", 6, 0 }, ;
{ "Norma " , "n", 8, 0 }, ;
{ "apartado " , "c", 10, 0 }, ;
{ "Fecha " , "d", 8, 0 }, ;
{ "Hora " , "c", 5, 0 }, ;
{ "Proceso " , "c", 10, 0 }, ;
{ "Resultado" , "m", 10, 0 }, ;
{ "Interna " , "c", 1, 0 }, ;
{ "Finalizada " , "D", 8, 0 } ;
} )
clos data
*/
REQUEST DBFCDX
RDDSETDEFAULT( "DBFCDX" )
/*
dbcreate( ".\prueba", { { "id" , "n", 8, 0 }, ;
{ "Cliente " , "n", 6, 0 }, ;
{ "Numero" , "n", 6, 0 }, ;
{ "Numero " , "n", 6, 0 }, ;
{ "Lider " , "n", 6, 0 }, ;
{ "Norma " , "n", 8, 0 }, ;
{ "apartado " , "c", 10, 0 }, ;
{ "Fecha " , "d", 8, 0 }, ;
{ "Hora " , "c", 5, 0 }, ;
{ "Proceso " , "c", 10, 0 }, ;
{ "Resultado" , "m", 10, 0 }, ;
{ "Interna " , "c", 1, 0 }, ;
{ "Finalizada " , "D", 8, 0 } ;
} )
clos data
dbcloseall()
*/
oCn := FW_OpenAdoConnection( "c:\fwh2212\samples\" )
oCnM := FW_OpenAdoConnection( { "FOXPRO", "c:\fwh2212\samples\"}, .f. )
csql := "INSERT INTO .\prudbt (cliente,Numero) VALUES ( 0, 21) "
oCn:Execute( csql )
csql := "INSERT INTO .\prueba (cliente,Numero) VALUES ( 0, 21) "
oCnm:Execute( csql )
oRs:Close()
oCn:Close()
oCnm:Close()
return nil
me da error :
Args:
[ 1] = C INSERT INTO .\prueba (cliente,Numero) VALUES ( 0, 21)
Stack Calls
===========
Called from: => TOLEAUTO:EXECUTE( 0 )
Called from: abd4.prg => MAIN( 59 )
Error con FW_OpenRecordSet
-
- Posts: 155
- Joined: Tue Oct 11, 2016 1:02 pm
- Location: Luján, bs. as.
Error con FW_OpenRecordSet
Jorge
Saludos.
Saludos.
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Error con FW_OpenRecordSet
Code: Select all | Expand
INSERT INTO tablename ...
Code: Select all | Expand
INSERT INTO .\tablename ...
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
-
- Posts: 155
- Joined: Tue Oct 11, 2016 1:02 pm
- Location: Luján, bs. as.
Re: Error con FW_OpenRecordSet
Mr. Rao, sigue el mismo error
Error description: Error ADODB.Connection/0 S_OK: EXECUTE
Args:
[ 1] = C INSERT INTO prueba (cliente,Numero) VALUES ( 0, 21)
Stack Calls
===========
Called from: => TOLEAUTO:EXECUTE( 0 )
Called from: abd4.prg => MAIN( 58 )
en el dbf prudbt inserta el registro sin problema, el error lo da en el dbf prueba
oCn := FW_OpenAdoConnection( "c:\fwh2212\samples\" )
oCnM := FW_OpenAdoConnection( { "FOXPRO", "c:\fwh2212\samples\"}, .t. )
csql := "INSERT INTO prudbt (cliente,Numero) VALUES ( 0, 21) "
oCn:Execute( csql )
csql := "INSERT INTO prueba (cliente,Numero) VALUES ( 0, 21) "
oCnm:Execute( csql )
Error description: Error ADODB.Connection/0 S_OK: EXECUTE
Args:
[ 1] = C INSERT INTO prueba (cliente,Numero) VALUES ( 0, 21)
Stack Calls
===========
Called from: => TOLEAUTO:EXECUTE( 0 )
Called from: abd4.prg => MAIN( 58 )
en el dbf prudbt inserta el registro sin problema, el error lo da en el dbf prueba
oCn := FW_OpenAdoConnection( "c:\fwh2212\samples\" )
oCnM := FW_OpenAdoConnection( { "FOXPRO", "c:\fwh2212\samples\"}, .t. )
csql := "INSERT INTO prudbt (cliente,Numero) VALUES ( 0, 21) "
oCn:Execute( csql )
csql := "INSERT INTO prueba (cliente,Numero) VALUES ( 0, 21) "
oCnm:Execute( csql )
Jorge
Saludos.
Saludos.