DBT ->FPT

DBT ->FPT

Postby Silvio.Falconi » Sat Nov 27, 2021 9:21 am

I'm converting a oldesta prg ( from clipper) and I have Dbf and Dbt, now I use Cdx and fpt
How I can change dbt on Fpt ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: DBT ->FPT

Postby Marc Venken » Sat Nov 27, 2021 10:00 am

I did it like this...

Comix will become "DBFCDX" now

Code: Select all  Expand view  RUN

FUNCTION dbffpt()
   //use emaillog
   //copy to c:\marc\fpt\emaillog.dbf via "COMIX"
   //close all
   //*
    LOCAL aFiles[ADIR("c:\marc\*.dbf")]
    cursorwait()
    ADIR("c:\marc\*.dbf", aFiles)
    asort(afiles)
    for i = 1 to len(aFiles)
       cFile = alltrim(aFiles[i])
       use &cfile
       cTarget = "c:\marc\fpt\" + cfile
       copy to &cTarget via "
COMIX"
       close all
    next
    */
   msginfo("
Done")
RETURN

Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: DBT ->FPT

Postby Silvio.Falconi » Sat Nov 27, 2021 10:06 am

Marc Venken wrote:I did it like this...

Comix will become "DBFCDX" now

Code: Select all  Expand view  RUN

FUNCTION dbffpt()
   //use emaillog
   //copy to c:\marc\fpt\emaillog.dbf via "COMIX"
   //close all
   //*
    LOCAL aFiles[ADIR("c:\marc\*.dbf")]
    cursorwait()
    ADIR("c:\marc\*.dbf", aFiles)
    asort(afiles)
    for i = 1 to len(aFiles)
       cFile = alltrim(aFiles[i])
       use &cfile
       cTarget = "c:\marc\fpt\" + cfile
       copy to &cTarget via "
COMIX"
       close all
    next
    */
   msginfo("
Done")
RETURN




I made
Code: Select all  Expand view  RUN


#include "fivewin.ch"

REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO


FUNCTION dbffpt()
   //use emaillog
   //copy to c:\marc\fpt\emaillog.dbf via "COMIX"
   //close all
   //*
    LOCAL aFiles[ADIR("*.dbf")]
    cursorwait()
    ADIR("*.dbf", aFiles)
    asort(afiles)
    for i = 1 to len(aFiles)
       cFile = alltrim(aFiles[i])
       use &cfile
       cTarget = ".\fpt\" + cfile
       copy to &cTarget via "
DBFCDX"
       close all
    next
   
   msginfo("
Done")
RETURN


make me error
Error occurred at: 11/27/21, 11:05:02
Error description: Error DBFNTX/1001 Open error: Agenti

Stack Calls
===========
Called from: => DBUSEAREA( 0 )
Called from: test.prg => DBFFPT( 20 )

System
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: DBT ->FPT

Postby Marc Venken » Sat Nov 27, 2021 10:14 am

Silvio..

You may have to set

RDDSetDefault( "DBFNTX" )
or
RDDSetDefault( "DBFCDX" )
or
use database via "DBFNTX"
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: DBT ->FPT

Postby Marc Venken » Sat Nov 27, 2021 10:27 am

This is working :

Code: Select all  Expand view  RUN

#include "fivewin.ch"

REQUEST DBFCDX
REQUEST DBFNTX
REQUEST DBFDBT
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO


FUNCTION dbffpt()
   //use emaillog
   //copy to c:\marc\fpt\emaillog.dbf via "COMIX"
   //close all
   //*
    LOCAL aFiles[ADIR("*.dbf")]
    cursorwait()
    ADIR("*.dbf", aFiles)
    asort(afiles)
    for i = 1 to len(aFiles)
       cFile = alltrim(aFiles[i])
       use &cfile via "DBFNTX"
       cTarget = ".\fpt\" + cfile
       copy to &cTarget via "
DBFCDX"
       close all
       if I = 10  // for testing
          exit
       endif
    next

   msginfo("
Done")
RETURN


Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: DBT ->FPT

Postby Silvio.Falconi » Sat Nov 27, 2021 11:52 am

thanks Great
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests