Error con FW_OpenRecordSet

Error con FW_OpenRecordSet

Postby jpcavagnaro » Tue Dec 19, 2023 7:16 pm

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 )
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.

Re: Error con FW_OpenRecordSet

Postby nageswaragunupudi » Wed Dec 20, 2023 3:29 am

Code: Select all  Expand view  RUN
INSERT INTO tablename ...

NOT
Code: Select all  Expand view  RUN
INSERT INTO .\tablename ...
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Error con FW_OpenRecordSet

Postby jpcavagnaro » Wed Dec 20, 2023 12:05 pm

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 )
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: driessen and 42 guests