problem with fw_adoexporttodbf function

problem with fw_adoexporttodbf function

Postby max » Sun May 12, 2019 7:52 pm

I think there is a bug in FW_AdoExportToDbf function. When it meets a SQL field type "varchar(MAX)", the output dbf is created with a character field (instead of "memo" field) length=0, and without content. To fix this problem, need to declare interactively the structure of dbf at runtime moving ".T." in the third parameter of the function. But in this way the program stops execution asking name and field attributes to the operator, and it is not always possible.
Detected with FWH version 1807 and exporting a table of a MSSQL database.
There is a way to solve? Thank you.
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Re: problem with fw_adoexporttodbf function

Postby nageswaragunupudi » Sun May 12, 2019 10:24 pm

This is taken care of in later versions of FWH.

Try making this modification in \fwh\source\function\adofuncs.prg
Locate the function function FWAdoFieldStruct( oRs, n )
Add these lines towards the end of the function just before "return"

Code: Select all  Expand view

if cType == "C" .and. nLen <= 0
   cType := "M"
   nLen := 10
endif
 


Please let us know if this works.
Regards

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

Re: problem with fw_adoexporttodbf function

Postby max » Mon May 13, 2019 6:18 am

Afther this change i have to recompile adofuncs.prg, right? How? Thank you.
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Re: problem with fw_adoexporttodbf function

Postby nageswaragunupudi » Mon May 13, 2019 6:34 am

After this change, you add the revise adofuncs.prg to your project as one of your prg files.
Regards

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

Re: problem with fw_adoexporttodbf function

Postby max » Tue May 14, 2019 6:04 am

Linking adofuncs.obj to my project now i receive these errors linking:

c:\myproject> if gtgui == gtgui c:\bcc7\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc

Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
Error: Unresolved external '___CPPdebugHook' referenced from C:\BCC7\LIB\CW32.LIB|xx
Error: Unresolved external '__hInstance' referenced from C:\BCC7\LIB\CW32.LIB|_fastmm
Error: Unresolved external '___System__GetTls' referenced from C:\BCC7\LIB\CW32.LIB|xxv
Error: Unable to perform link
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Re: problem with fw_adoexporttodbf function

Postby Antonio Linares » Tue May 14, 2019 4:05 pm

Max,

Have you recently modified your bcc7 files ?

Please check that you are using the right bcc7 libraries
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: problem with fw_adoexporttodbf function

Postby Antonio Linares » Tue May 14, 2019 4:22 pm

Max,

Please post here your make file or batch file that you use to build your app, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: problem with fw_adoexporttodbf function

Postby max » Tue May 14, 2019 4:46 pm

No Antonio, i have not modify my BCC7 files (far from me! :) ) . And all other my projects without link to adofuncs.prg are ok with this batch for compile and linking. Perhaps I've been doing something wrong since I added adofuncs(!?). This is the batch i use:
Code: Select all  Expand view

@ECHO OFF
ECHO Compiling...
TSKILL MARGINI
if "%FWDIR%" == "" set FWDIR=c:\fwh
if "%XHDIR%" == "" set XHDIR=c:\xharbour
SET HARBOURCMD=/a /es2 /gc0 /m /n /q
set GT=gtgui

set hdir=%XHDIR%
set hdirl=%hdir%\lib
set bcdir=c:\bcc7
set fwh=%FWDIR%

%hdir%\bin\harbour main /i%fwh%\include;%hdir%\include > comp.log 2> warnings.log
%hdir%\bin\harbour adofuncs /i%fwh%\include;%hdir%\include > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERRORS
@type comp.log
@type warnings.log
echo -O2 -emain.exe -I%hdir%\include -I%bcdir%\include main.c adofuncs.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:ENDCOMPILE

IF EXIST main.rc %bcdir%\bin\brc32 -r -I%bcdir%\include main

echo %bcdir%\lib\c0w32.obj + > b32.bc
echo adofuncs.obj + > b32.bc
echo main.obj, + >> b32.bc
echo MARGINI.exe, + >> b32.bc
echo MARGINI.map, + >> b32.bc
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib + >> b32.bc
echo %hdirl%\rtl.lib + >> b32.bc
echo %hdirl%\vm.lib + >> b32.bc
echo %hdirl%\%GT%.lib + >> b32.bc
echo %hdirl%\lang.lib + >> b32.bc
echo %hdirl%\macro.lib + >> b32.bc
echo %hdirl%\rdd.lib + >> b32.bc
echo %hdirl%\dbfntx.lib + >> b32.bc
echo %hdirl%\dbfcdx.lib + >> b32.bc
echo %hdirl%\dbffpt.lib + >> b32.bc
echo %hdirl%\hbsix.lib + >> b32.bc
echo %hdirl%\debug.lib + >> b32.bc
echo %hdirl%\common.lib + >> b32.bc
echo %hdirl%\pp.lib + >> b32.bc
echo %hdirl%\pcrepos.lib + >> b32.bc
echo %hdirl%\ct.lib + >> b32.bc
echo %hdirl%\zlib.lib + >> b32.bc
echo %hdirl%\hbzip.lib + >> b32.bc
echo %hdirl%\libmisc.lib + >> b32.bc
echo %hdirl%\tip.lib + >> b32.bc
echo %hdirl%\png.lib + >> b32.bc

rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib + >> b32.bc
rem echo %hdir%\lib\Ace32.lib + >> b32.bc

echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\uuid.lib + >> b32.bc
echo %bcdir%\lib\ws2_32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc

IF EXIST main.res echo main.res >> b32.bc

rem uncomment this line to use the debugger and comment the following one
if %GT% == gtwin %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
if %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
CALL MARGINIS.BAT
GOTO EXIT
ECHO

rem delete temporary files
@del main.c

:COMPILEERRORS
@type comp.log
ECHO * Compile errors *
pause
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
pause
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi¢n PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG main does not exist

:EXIT
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Re: problem with fw_adoexporttodbf function

Postby max » Wed May 15, 2019 5:40 am

And this is the content of my c:\BCC7\LIB folder:
Code: Select all  Expand view

 Directory di c:\BCC7\lib

15/05/2019  07:39    <DIR>          .
15/05/2019  07:39    <DIR>          ..
19/03/2015  05:55             2.761 c0d32.obj
19/03/2015  05:55             2.764 c0d32w.obj
19/03/2015  05:55             2.670 c0d32x.obj
19/03/2015  05:55             2.334 c0fmx32.obj
19/03/2015  05:55             2.339 c0fmx32w.obj
19/03/2015  05:55             2.305 c0w32.obj
19/03/2015  05:55             2.311 c0w32w.obj
19/03/2015  05:55             2.282 c0x32.obj
19/03/2015  05:55             2.307 c0x32w.obj
19/03/2015  05:55           213.504 cg32.lib
19/03/2015  05:55             2.560 cghelp.lib
19/03/2015  05:55         2.030.592 cp32mt.lib
19/03/2015  05:55           572.928 cp32mti.lib
19/03/2015  05:55         1.982.464 cw32.lib
19/03/2015  05:55           561.664 cw32i.lib
19/03/2015  05:55         2.037.760 cw32mt.lib
19/03/2015  05:55           570.368 cw32mti.lib
19/03/2015  05:55         1.384.960 import32.lib
19/04/2018  12:26    <DIR>          psdk
19/03/2015  05:55             2.048 uuid.lib
19/03/2015  05:55            21.504 wininet.lib
19/03/2015  05:55            13.312 ws2_32.lib
              22 File      9.415.737 byte
 
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Re: problem with fw_adoexporttodbf function

Postby nageswaragunupudi » Wed May 15, 2019 6:13 am

Please try to change this part

Code: Select all  Expand view
echo %bcdir%\lib\c0w32.obj + > b32.bc
echo adofuncs.obj + > b32.bc
echo main.obj, + >> b32.bc
 


as
Code: Select all  Expand view
echo %bcdir%\lib\c0w32.obj + > b32.bc
echo main.obj + > b32.bc
echo adofuncs.obj, + >> b32.bc
 
Regards

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

Re: problem with fw_adoexporttodbf function

Postby max » Wed May 15, 2019 7:11 am

modified and tried, but the same errors remain. Now my b32.bc file has this content:
Code: Select all  Expand view
main.obj +
adofuncs.obj, +
MARGINI.exe, +
MARGINI.map, +
c:\fwh\lib\Fivehx.lib c:\fwh\lib\FiveHC.lib +
c:\xharbour\lib\rtl.lib +
c:\xharbour\lib\vm.lib +
c:\xharbour\lib\gtgui.lib +
c:\xharbour\lib\lang.lib +
c:\xharbour\lib\macro.lib +
c:\xharbour\lib\rdd.lib +
c:\xharbour\lib\dbfntx.lib +
c:\xharbour\lib\dbfcdx.lib +
c:\xharbour\lib\dbffpt.lib +
c:\xharbour\lib\hbsix.lib +
c:\xharbour\lib\debug.lib +
c:\xharbour\lib\common.lib +
c:\xharbour\lib\pp.lib +
c:\xharbour\lib\pcrepos.lib +
c:\xharbour\lib\ct.lib +
c:\xharbour\lib\zlib.lib +
c:\xharbour\lib\hbzip.lib +
c:\xharbour\lib\libmisc.lib +
c:\xharbour\lib\tip.lib +
c:\xharbour\lib\png.lib +
c:\bcc7\lib\cw32.lib +
c:\bcc7\lib\import32.lib +
c:\bcc7\lib\uuid.lib +
c:\bcc7\lib\ws2_32.lib +
c:\bcc7\lib\psdk\odbc32.lib +
c:\bcc7\lib\psdk\rasapi32.lib +
c:\bcc7\lib\psdk\nddeapi.lib +
c:\bcc7\lib\psdk\msimg32.lib +
c:\bcc7\lib\psdk\psapi.lib +
c:\bcc7\lib\psdk\gdiplus.lib +
c:\bcc7\lib\psdk\iphlpapi.lib +
c:\bcc7\lib\psdk\shell32.lib,
main.res
 
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Re: problem with fw_adoexporttodbf function

Postby Compuin » Mon Dec 02, 2019 8:10 pm

Hello

I'm facing the same issue when I'm trying to attach a .C file to my project

echo ..\..\bcc710\lib\psdk\iphlpapi.lib + >> b32.bc
echo ..\..\bcc710\lib\psdk\shell32.lib, >> b32.bc
IF EXIST demo.res echo demo.res >> b32.bc
..\..\bcc710\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
Turbo Incremental Link 6.72 Copyright (c) 1997-2015 Embarcadero Technologies, Inc.
Error: Unresolved external '___CPPdebugHook' referenced from C:\BCC710\LIB\CW32.LIB|xx
Error: Unresolved external '__hInstance' referenced from C:\BCC710\LIB\CW32.LIB|_fastmm
Error: Unresolved external '___System__GetTls' referenced from C:\BCC710\LIB\CW32.LIB|xxv
Error: Unable to perform link

** error 2 ** deleting demo.exe

C:\demo>if exist demo.exe demo.exe
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: problem with fw_adoexporttodbf function

Postby max » Tue Dec 03, 2019 9:37 am

I still have the same unresolved problem today
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Re: problem with fw_adoexporttodbf function

Postby nageswaragunupudi » Tue Dec 03, 2019 9:42 am

In case you are using the next version immediately after this post, you need not recompile adofuncs.prg. You can use FWH libraries without any change.
Regards

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

Re: problem with fw_adoexporttodbf function

Postby max » Tue Dec 03, 2019 10:01 am

ok thanks Nages. In other words, I have to buy the updated version today to solve the problem reported here of FW_AdoExportToDbf with SQL field type varchar(max). Is it right?
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 40 guests

cron