Error al Crear DBF

Error al Crear DBF

Postby remtec » Sat Feb 23, 2019 3:32 pm

Hola Amigos.

Hoy he tratado de crear una DBF y me arroja error al compilar.

Muchos Saludos.
Antonio

Codigo Prg
Code: Select all  Expand view

#include "FiveWin.ch"
#include "richedi5.ch"

//----------------------------------------------------------------------------//
ANNOUNCE RDDSys
INIT Procedure RDDInit()
  REQUEST DBFCDX
  RDDSetDefault( "DBFCDX")


function Main()

   local oDlg
   local oRich
   //
   //local hRichDLL  := LoadLibrary( "riched20.dll" )
   //
   local lSyntaxHL := .f.
   local cTxt      := ""
     Local oFont1,oFont2,oSay1,oSay2,oSay3,oSay4,oFont3

     Crea_dbf()


   use exa2
         go top

     if eof()

                 cTxt =  "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Microsoft Sans Serif;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}" + ;
             "{\colortbl ;\red128\green0\blue0;\red0\green0\blue0;\red0\green128\blue0;\red255\green0\blue0;}" + ;
             "\viewkind4\uc1\pard\cf1\b\i\f0\fs28 JH\cf2\b0\i0  - Sue let me \cf3 know\cf2  that their rep had noticed that they were not performing the yearly \cf4\ul\b\fs24 escrow\cf2\ulnone\b0\fs28  analysis.\cf0\f1\fs17\par" + ;
             "}"
        else
                    cTxt=exa->cod_det
                    close
        endif
        close

   DEFINE DIALOG oDlg RESOURCE "#1008"
   oDlg:lHelpIcon   := .F.

   oRich := TRichEdit5():Redefine( 4001, bSETGET( cTxt ), oDlg )

   ACTIVATE DIALOG oDlg CENTERED ;  //
      ON INIT ( oRich:LoadRtf( cTxt ), oRich:PostMsg( WM_KEYDOWN, VK_HOME, 0 ) ) ;
      VALID ( cTxt := oRich:SaveAsRTF(), .T. )


return nil


Static Function Crea_dbf()
        if !file('exa2.dbf')
                aStruct := { ;
                { "FOLIO",      "N", 10, 0 },;
                { "COD_DET",    "M", 10, 0 } }

            REQUEST DBFCDX
            DbCreate( "EXA2.DBF", aStruct, "DBFCDX")
        endif
    Return nil

 


Error al Compilar:
Code: Select all  Expand view

pplication
===========
   Path and name: C:\Util\fwh1709\pruebas\edita1.exe (32 bits)
   Size: 3,842,560 bytes
   Compiler version: Harbour 3.2.0dev (r1506171039)
   FiveWin  version: FWH 17.09
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 02/23/19, 12:30:21
   Error description: Error DBFCDX/1020  Create error: EXA2

Stack Calls
===========
   Called from:  => DBCREATE( 0 )
   Called from: edita1.prg => CREA_DBF( 60 )
   Called from: edita1.prg => MAIN( 22 )

System
======
   CPU type: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz 2594 Mhz
   Hardware memory: 8085 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 5
      1 ,                                                                                                    
      2 , C:\Util\fwh1709\pruebas\edita1.exe                                                                  
      3 , C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.17134.590_none_4104ef
      4 DDE Server Window, C:\WINDOWS\System32\OLE32.DLL                                                                      
      5 G, C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.17134.590_none_73d5c5bb9f78835

Variables in use
================
   Procedure     Type   Value
   ==========================
   DBCREATE
     Param   1:    O    Class: ERROR
   CREA_DBF
     Param   1:    C    "EXA2.DBF"
     Param   2:    A    Len:    2
     Param   3:    C    "DBFCDX"
     Local   1:    U    
     Local   2:    U    
   MAIN

Linked RDDs
===========
   DBF
   DBFCDX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TREG32
     5 TSTRUCT

Memory Analysis
===============
      373 Static variables

   Dynamic memory consume:
      Actual  Value:          0 bytes
      Highest Value:          0 bytes

 
Last edited by remtec on Sat Feb 23, 2019 4:44 pm, edited 1 time in total.
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 719
Joined: Fri May 12, 2017 2:50 pm

Re: Error al Crear DBF

Postby acuellar » Sat Feb 23, 2019 3:40 pm

Estimado,
Aquí un ejemplo

Code: Select all  Expand view

 IF !FILE( "FACTURAS.DBF" )
 
      xBASE:=cPath+"FACTURAS.DBF"
       DbCreate( xBase, { { "FACTURA","C",7,0 },{ "ORDEN","N",15,0 },{ "FECHA", "D", 1,0 },{ "CLIENTE","C",70,0 },;
              { "NITCI","C",14,0},{ "HAB", "N",9,2 },{ "EXT",  "N", 9,2 },{ "ALI","N", 9,2 },{ "BEB","N", 9,2 },;
              { "DONC", "N",9,2 },{ "LAV", "N",9,2 },{ "VIV",  "N", 9,2 },{ "EVE","N", 9,2 },{ "PIS","N", 9,2 },;
              { "RSER", "N",9,2 },{ "MINI","N",9,2 },{ "OTR",  "N", 9,2 },{ "JDA","N", 9,2 },{ "DET1","C",50,0 },{ "DET2","C",50,0 },;
              {"IMPORTE","N",10,2},{ "PROPINAS","N", 9,2 },{"PRESTDEV","N",9,2 },{"CODCTROL","C",14,0 },{ "VA",   "C",2,0 },;
              { "CE", "C",2,0 },{ "IMPRESA","C", 1,0 },{ "USUARIO", "C", 11,0 },{ "RVC", "C", 7,0 },{ "COPIA", "M",10,0 },{ "NONITCI","C",14,0},{ "FECHAUD", "D", 1,0 } },"DBFCDX" )
Endif
 
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1643
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Error al Crear DBF

Postby remtec » Sat Feb 23, 2019 3:50 pm

Hola Acuellar

Muchas gracias por responder.

Algo extraño sucede, ya que el codigo que tengo antes funcionaba para otra versiona de FWH y hora no.
Uso FWH 17.09 y Harbour y windows 10.

Saludos
Antonio.

He aplicado tu codigo y arroja este error:

Code: Select all  Expand view

Application
===========
   Path and name: C:\Util\fwh1709\pruebas\edita1.exe (32 bits)
   Size: 3,843,072 bytes
   Compiler version: Harbour 3.2.0dev (r1506171039)
   FiveWin  version: FWH 17.09
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 02/23/19, 12:45:08
   Error description: Error DBFCDX/1020  Create error: FACTURAS

Stack Calls
===========
   Called from:  => DBCREATE( 0 )
   Called from: edita1.prg => CREA_DBF( 72 )
   Called from: edita1.prg => MAIN( 22 )

System
======
   CPU type: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz 2594 Mhz
   Hardware memory: 8085 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 5
      1 ,                                                                                                    
      2 , C:\Util\fwh1709\pruebas\edita1.exe                                                                  
      3 , C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.17134.590_none_4104ef
      4 DDE Server Window, C:\WINDOWS\System32\OLE32.DLL                                                                      
      5 G, C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.17134.590_none_73d5c5bb9f78835

Variables in use
================
   Procedure     Type   Value
   ==========================
   DBCREATE
     Param   1:    O    Class: ERROR
   CREA_DBF
     Param   1:    C    "FACTURAS.DBF"
     Param   2:    A    Len:   32
     Param   3:    C    "DBFCDX"
     Local   1:    U    
     Local   2:    U    
   MAIN

Linked RDDs
===========
   DBF
   DBFCDX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TREG32
     5 TSTRUCT

Memory Analysis
===============
      373 Static variables

   Dynamic memory consume:
      Actual  Value:          0 bytes
      Highest Value:          0 bytes

 
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 719
Joined: Fri May 12, 2017 2:50 pm

Re: Error al Crear DBF

Postby remtec » Sat Feb 23, 2019 5:20 pm

Amigos

Alguna idea del porque sucede este error.

Necesito q se cree esta DBF desde el PRG.

Saludos
Antonio
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 719
Joined: Fri May 12, 2017 2:50 pm

Re: Error al Crear DBF

Postby armando.lagunas » Sat Feb 23, 2019 5:34 pm

Code: Select all  Expand view


 oApp:cTemp := "c:\temporales"
...
...


  IF !FILE(oApp:cTemp+"\CONG144.DBF")   // Cartola Materiales
         DbCreate(oApp:cTemp+"\CONG144.DBF",   { { "RUTT"  ,"C", 10, 0 },;
                                                 { "CODE"  ,"C",  8, 0 },;
                                                 { "TIPO"  ,"C",  3, 0 },;
                                                 { "UNID"  ,"C",  2, 0 },;
                                                 { "DESC"  ,"C", 80, 0 },;
                                                 { "ENTR"  ,"N", 15, 2 },;
                                                 { "SALI"  ,"N", 15, 2 },;
                                                 { "SALD"  ,"N", 15, 2 },;
                                                 { "ID"    ,"C",  1, 0 } } )
   ENDIF

 


yo lo uso asi sin problemas.
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: Error al Crear DBF

Postby remtec » Sun Feb 24, 2019 3:36 am

Hola Armando.

Muchas gracias por tu ayuda.

Al igual que Acuellar, que respondio a mi consulta.

Algo extraño, tu codigo funciono perfecto y nunca super porque se producia el error.

Muchos Saludos.
Antonio
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 719
Joined: Fri May 12, 2017 2:50 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], russimicro and 43 guests