Test ado rdd app

Test ado rdd app

Postby pieter » Wed Jun 24, 2015 11:31 am

Hello :D

Goal:
To get an working example of adorrdd

Background information:
-Borland 5.82 compiler
-Fivewin 2015
-Xharbour 1.2.3 Intl. (SimpLex) (Build 20150213)

Action steps that I did:
-I Downloaded adordd-master.zip from file https://github.com/AHFERREIRA/adordd
-I extracted the content of adordd-master.zip in the folder "C:\Pieter\adorddtest"
-I copied the file buildx.bat from C:\Pieter\fwh\samples and renamed it to buildx-bcc582.bat
-I changed some code of buildx-bcc582.bat, so that I could compile and run tutor01.prg(just for testing the .bat file)
-I made a file called adorddtest.prg and I opened the file 01_README.pdf(the documentation of adordd)

Questions
Now I am missing some basic knowlegde about (X)Harbour Compilers, Linkers, .obj etc.:
Here, there is what I think I already know:

Commandline: C:\Pieter\adorddtest> buildx-bcc582 adorddtest
Code: Select all  Expand view
%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
:
The (X)harbour compiler compiles adorddtest.prg to adorddtest.ppo and then the (X)harbour compiler compiles adorddtest.ppo to adorddtest.c.

Code: Select all  Expand view
echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include %1.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:
%1.c is adordd.c, The borland 5.82 compiler compiles the .c into .obj
There is some code above that I don't know how to read exacly. So if you know some good educational sources I could read or listen/watch, that would be great.
What does b32.bc means?

Code: Select all  Expand view

echo %bcdir%\lib\c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib + >> b32.bc

etc.
 

I understand the principle that all kind of .lib files and other files have to be put in b32.bc

Code: Select all  Expand view

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
 


All the files (in b32.bc) are linked together and one executable (.exe) will be generated.


I tried the following thing:
Commandline: C:\Pieter\adorddtest>c:\Pieter\xharbour123\bin\harbour adordd /n /ic:\Pieter\fwh\include;c:\Pieter\xharbour123\include (To compile adordd.prg to adordd.c) (I noticed that adordd.ppo is not made)

I also tried it with
Code: Select all  Expand view
%hdir%\bin\harbour adordd /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
in the buildx-bcc32.bat file. (here I got an adordd.ppo)

How can I compile adordd.c to adordd.obj?

after that I want to do something with
Code: Select all  Expand view
echo adordd.obj + >> b32.bc


I noticed while writing this first post, I already learned something (without someone telling met something), this is probably because writing down questions as specific as possible is already useful.



adorddtest.prg:
Code: Select all  Expand view

#include "FiveWin.ch"
#include "adordd.ch"

function Main()

  MsgInfo( "Start Program" )
   
  RddRegister("ADORDD",1)
  RddSetDefault("ADORDD")
   
return nil
 


buildx-bcc582.bat:
Code: Select all  Expand view

@ECHO OFF
CLS
ECHO 旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커
ECHO ?FiveWin for xHarbour 15.01 - Jan. 2015          xHarbour development power
ECHO ?(c) FiveTech, 1993-2015   for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8
ECHO 읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴켸?
ECHO  賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽?

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

if "%FWDIR%" == "" set FWDIR=c:\Pieter\fwh
if "%XHDIR%" == "" set XHDIR=c:\Pieter\xharbour123
rem if "%2" == "/b" set GT=gtwin
rem if not "%2" == "/b" set GT=gtgui
set GT=gtgui

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

set hdir=c:\Pieter\xharbour123
set hdirl=%hdir%\lib
set bcdir=c:\Pieter\bcc582
set fwh=c:\Pieter\fwh


%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERRORS
@type comp.log
@type warnings.log

echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include %1.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:ENDCOMPILE

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

echo %bcdir%\lib\c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.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 %1.res echo %1.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 *
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c

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

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

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

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT



tutor01.prg
Code: Select all  Expand view
// Typical Welcome message, from Windows!

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   MsgInfo( "Hello world from Harbour and FWH!" )
   
return nil

//----------------------------------------------------------------------------//
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: Test ado rdd app

Postby James Bott » Tue Jul 07, 2015 10:49 pm

Pieter,

You didn't say what your problem or error was.

Take a look at the last 2-3 pages of this thread:

viewtopic.php?f=3&t=30266&start=735

You seem to have forgotten to add the adordd.lib file to the buildx.bat. It has to be in a specific place which is explained in one of my posts.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Test ado rdd app

Postby pieter » Wed Jul 08, 2015 3:11 pm

Hello James,

Thank you very much.

The problem that I had is that I could not make a adordd.obj, and put this line echo adordd.obj + >> b32.bc in buildx.bat

Today I have compiled the following program:

Code: Select all  Expand view
#include "FiveWin.ch"
#include "adordd.ch"

REQUEST ADORDD, ADOVERSION

function Main()

  MsgInfo( "Start Program" )
  RddRegister("ADORDD",1)
  RddSetDefault("ADORDD")
   
return nil


旼컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴커
?FiveWin for xHarbour 15.01 - Jan. 2015 xHarbour development power 넵
?(c) FiveTech, 1993-2015 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8 넴
읕컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴켸?
 賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽賽?
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20150213)
Copyright 1999-2015, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'adordd.prg' and generating preprocessed output to 'adordd.ppo'...

100

100

100

200

100

100

200

300

100

200

300

100

200

300

400

500

600

700

800

900

1000

1100

1200

1300

1400

1500

1600

1700

1800

1900

2000

2100

2200

2300

2400

2500

2600

2700

2800

2900

3000

3100

3200

3300

3400

3500

3600

3700

3800

3900

4000

4100

4200

4300

4400

4500

4600

4700

4800

4900

5000

5100

5200

5300

5400
Generating C source output to 'adordd.c'...
Done.

Lines 5386, Functions/Procedures 133, pCodes 17988

adordd.prg(4470) Warning W0001 Ambiguous reference: 'LRET'

adordd.prg(4475) Warning W0001 Ambiguous reference: 'LRET'

adordd.prg(4480) Warning W0001 Ambiguous reference: 'LRET'

adordd.prg(5385) Warning W0030 STATIC Function 'ADOCOPYFILE' defined but never used

adordd.prg(5385) Warning W0030 STATIC Function 'ADOERASE' defined but never used

adordd.prg(5385) Warning W0030 STATIC Function 'ADORENAME' defined but never used
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
adorddtest.c:
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_HB_FUN_ADORDD' referenced from C:\PIETER\ADORDDTEST\ADORDDTEST.OBJ
Error: Unresolved external '_HB_FUN_ADOVERSION' referenced from C:\PIETER\ADORDDTEST\ADORDDTEST.OBJ
* Linking errors *

Where can I find this adordd.lib or do I have to make it myself? (from adordd.prg?)

Best regards.

Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: Test ado rdd app

Postby James Bott » Wed Jul 08, 2015 3:52 pm

Pieter,

You need to make the ADORDD.LIB yourself. I use the TLIB.EXE program included with the Borland compiler.

Code: Select all  Expand view
tlib adordd.lib +adordd.obj


Here is my simplest test program.

Code: Select all  Expand view
/*
Purpose: Simple as possible ADORDD test
Author : James Bott
Date   : 6/30/2015 5:02:35 PM
Notes: Also requires buildx.bat file to be modified in specific ways.

*/


#include "fivewin.ch"
#include "adordd.ch"

REQUEST ADORDD, ADOVERSION

FUNCTION Main()

   RddRegister("ADORDD",1)
   RddSetDefault("ADORDD")
   
   SET ADO FORCE LOCK OFF   // Required!

   SET ADO DEFAULT DATABASE TO "northwind.mdb" ;
       SERVER TO "Microsoft.Jet.OLEDB.4.0"       ;
       ENGINE TO "ACCESS"

   USE CUSTOMERS
   BROWSE()

Return nil


And here is my buildx.bat. Note that there are three new LIBs, adordd.lib, rdds.lib, and usrrdd.lib.

Code: Select all  Expand view
@ECHO OFF
CLS
ECHO

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for xHarbour 15.05 - Jun. 2015          xHarbour development

power ³Ü
ECHO ³ (c) FiveTech, 1993-2015   for Microsoft Windows

9X/NT/200X/ME/XP/Vista/7/8 ³Û
ECHO

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

Û James Bott
ECHO ÿ

ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

if "%FWDIR%" == "" set FWDIR=c:\FWH
if "%XHDIR%" == "" set XHDIR=c:\xharbour
rem if "%2" == "/b" set GT=gtwin
rem if not "%2" == "/b" set GT=gtgui
set GT=gtgui

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

%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log

2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERRORS
@type comp.log
@type warnings.log

echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include %1.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:ENDCOMPILE

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

echo %bcdir%\lib\c0w32.obj + > b32.bc

rem Add this here:
echo adordd.lib + >> b32.bc

echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.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

Add these here:
echo %hdirl%\rdds.lib + >> b32.bc
echo %hdirl%\usrrdd.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 %1.res echo %1.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 *
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c
@del %1.obj
@del %1.tds
@del %1.map
@del %1.ppo

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

:LINKERROR
ECHO * Linking errors *
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 %1 does not exist

:EXIT


James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Test ado rdd app

Postby pieter » Thu Jul 09, 2015 8:29 am

James,

It is working:D (with mysql), I am really amazed!

Code: Select all  Expand view
   #include "fivewin.ch"
    #include "adordd.ch"

    REQUEST ADORDD, ADOVERSION

    FUNCTION Main()

       RddRegister("ADORDD",1)
       RddSetDefault("ADORDD")
       
       SET ADO FORCE LOCK OFF   // Required!
   
       SET ADO DEFAULT DATABASE TO "<databasesname>" SERVER TO "localhost"  ENGINE TO "MYSQL" USER TO "root" PASSWORD TO "<password>"
       
       USE CUSTOMER
       BROWSE()

    Return nil


Thank you:)

Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: Test ado rdd app

Postby James Bott » Thu Jul 09, 2015 3:08 pm

Pieter,

Glad to hear you got it working. The more of us that test the RDD the better for everyone. Please post any successes and problems you have.

Just yesterday I started making a list of tests I want to run. I will be posting the results--but I don't know when I am going to get to them as I have a busy schedule right now.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Test ado rdd app

Postby pieter » Fri Jul 10, 2015 12:48 pm

James,

If there is something else which I can do (besides posting successes and problems), I would like to know more about it. If the tests you want to run are relatively easy and only a bit timeconsuming, I could maybe help.

Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 25 guests