DbCopyStruct

DbCopyStruct

Postby hua » Mon May 20, 2024 3:19 am

Hi guys,
when I tried to compile with BCC7.7 and Harbour I get unresolved external for dbCopyStruct().
The function is in which lib? For now I use __dbCopyStruct() instead
TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: DbCopyStruct

Postby nageswaragunupudi » Mon May 20, 2024 3:59 am

Both dbCopyStruct() and __dbCopyStruct() (with the same functionality) are supported only by xHarbour.
Harbour provides __dbCopyStruct() only.

My humbles submission:
It is always a good practice to use COMMAND syntax where available
We will not get into these problems
eg:
Code: Select all  Expand view  RUN
COPY STRUCTURE TO cnewdbf
Regards

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

Re: DbCopyStruct

Postby hua » Mon May 20, 2024 5:12 am

Thanks for the explanation Rao.
I am using dbCopyStruct() because I was sub-classing TDatabase() to add that function.
Code: Select all  Expand view  RUN
method dbCopyStruct(cDataBase, aFieldList) inline ( ::cAlias )->(__dbCopyStruct(cDataBase, aFieldList))
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: DbCopyStruct

Postby karinha » Mon May 20, 2024 12:58 pm

Code: Select all  Expand view  RUN

// C:\FHW\SAMPLES\DBSTRUCT.PRG

#include "FiveWin.ch"

// Require: RDD.LIB

FUNCTION Main()

   /*
   // Create a new file that contain part of the original structure
   LOCAL aList

   USE TEST

   aList := { "STATE" }

   // dbCopyStruct( "ONLYNAME.dbf",  aList ) // xHarbour only

   __dbCopyStruct( "ONLYNAME.dbf",  aList )  // Harbour / xHarbour
   */


   // .and.

   // Open a database,  then copy its structure to a new file,
   // Open the new file and list all its records
   USE Test

   // dbCopyXStruct( "TestStru" )  // xHarbour Only

   __dbCopyXStruct( "TestStru" )   // xHarbour .AND. Harbour

   USE TestStru

   BROWSE()

RETURN NIL

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DbCopyStruct

Postby karinha » Mon May 20, 2024 3:30 pm

Code: Select all  Expand view  RUN

Harbour:

C:\HBBCC74\src\rdd

03/04/2020  19:58             5.900 dbstrux.prg

xHarbour:

C:\XHBBCC74\source\rdd

25/02/2020  13:20            13.638 dbstrux.prg
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests