Problem with ADS

Problem with ADS

Postby James Bott » Thu Jan 05, 2006 7:18 pm

I am trying (for the first time) to create an application to access an ADS database. I am getting the following error when linking:

Error: Unresolved external '_HB_FUN_ADSCONNECT60'

I am calling the adsconnect60() function.

I am linking in both ace32.lib and rddads.lib. The Harbour ver 45 that I got came with rddads.lib dated 5/9/2005, but there was no ace32.lib so I copied one from a previous version of Harbour. It is dated 7/12/2003. I am wondering if that might be the problem. Does anyone have a newer version?

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

Postby Antonio Linares » Thu Jan 05, 2006 7:39 pm

James,

Please create ace32.lib from the ace32.dll that you are using:

implib.exe ace32.lib ace32.dll
regards, saludos

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

Postby James Bott » Fri Jan 06, 2006 1:06 am

Thanks, Antonio, that worked, however I still have the problem.

I obtained a copy of the source for rddads.lib and the three files (ads1.c, adsfunc.c, and adsmgmnt.c) are all dated last month. The adsconnect60() function is in the source, so I assume the function is NOT in the source of the version of rddads.lib that came with Harbour 45. When I try to compile the new source I get lots of errors (see below). I don't know C++, so I don't know what to look for. I expect I am not compiling properly, but I am using the makefile.bc that came with the source (also below).

Any ideas?

James

-----------------------
makefile.bc (slightly modifed with my paths):

#
# $Id: makefile.bc,v 1.5 2005/10/04 15:52:39 kaddath Exp $
#

# makefile for Borland C/C++ 32 bits
# Building of rddads.lib - RDD for Advantage Database Server

INCLUDE_DIR = ..\include;c:\bc55\include

BIN_DIR = ..\..\..\bcc55\bin
OBJ_DIR = ..\obj\b32
LIB_DIR = ..\lib\b32

$(LIB_DIR)\rddads.lib : \
$(OBJ_DIR)\ads1.obj \
$(OBJ_DIR)\adsfunc.obj \
$(OBJ_DIR)\adsmgmnt.obj

$(OBJ_DIR)\ads1.obj : ads1.c
$(OBJ_DIR)\adsfunc.obj : adsfunc.c
$(OBJ_DIR)\adsmgmnt.obj : adsmgmnt.c

.c.obj:
$(BIN_DIR)\bcc32 $(CLIBFLAGS) $(C_USR) -c -O2 -DWIN32 -I$(INCLUDE_DIR) -o$@ $<
tlib $(LIB_DIR)\rddads.lib -+$@,,

.prg.c:
$(BIN_DIR)\harbour.exe $< -q0 -w -es2 -gc0 -n -i$(INCLUDE_DIR) -o$@


---------------------------------
Compile errors:

MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
..\..\..\bcc55\bin\bcc32 -c -O2 -DWIN32 -I..\include;c:\bc55\include -o..\obj\b32\ads1.obj ads1.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
ADS1.C:
Error E2139 ..\include\rddads.h 96: Declaration missing ;
Warning W8075 ADS1.C 539: Suspicious pointer conversion in function adsGetRelPos
Warning W8075 ADS1.C 550: Suspicious pointer conversion in function adsGetRelPos
Error E2451 ADS1.C 580: Undefined symbol 'isOptimized' in function adsSetRelPos
Error E2451 ADS1.C 701: Undefined symbol 'isOptimized' in function adsGoBottom
Error E2451 ADS1.C 750: Undefined symbol 'isOptimized' in function adsGoTo
Error E2451 ADS1.C 821: Undefined symbol 'isOptimized' in function adsGoTop
Error E2451 ADS1.C 891: Undefined symbol 'isOptimized' in function adsSeek
Error E2451 ADS1.C 950: Undefined symbol 'fOptimized' in function adsSeek
Warning W8004 ADS1.C 995: 'u32Result' is assigned a value that is never used in function adsSeek
Error E2451 ADS1.C 1068: Undefined symbol 'fOptimized' in function adsSkip
Error E2451 ADS1.C 1108: Undefined symbol 'fOptimized' in function adsSkip
Error E2451 ADS1.C 1156: Undefined symbol 'fOptimized' in function adsSkipFilter
Error E2451 ADS1.C 1218: Undefined symbol 'isOptimized' in function adsAppend
Warning W8075 ADS1.C 1246: Suspicious pointer conversion in function adsAppend
Warning W8075 ADS1.C 2139: Suspicious pointer conversion in function adsRecInfo
Warning W8075 ADS1.C 2156: Suspicious pointer conversion in function adsRecInfo
Warning W8075 ADS1.C 2171: Suspicious pointer conversion in function adsRecInfo
Warning W8075 ADS1.C 2214: Suspicious pointer conversion in function adsRecId
Error E2451 ADS1.C 2245: Undefined symbol 'ulConnection' in function adsCreate
Error E2451 ADS1.C 2245: Undefined symbol 'ulConnection' in function adsCreate
Warning W8075 ADS1.C 2492: Suspicious pointer conversion in function adsInfo
Warning W8075 ADS1.C 2530: Suspicious pointer conversion in function adsInfo
Error E2451 ADS1.C 2619: Undefined symbol 'ulConnection' in function adsOpen
Error E2451 ADS1.C 2619: Undefined symbol 'ulConnection' in function adsOpen
Error E2451 ADS1.C 2986: Undefined symbol 'isOptimized' in function adsForceRel
Error E2451 ADS1.C 3024: Undefined symbol 'isOptimized' in function adsSetRel
Warning W8004 ADS1.C 3027: 'ulRetVal' is assigned a value that is never used in function adsSetRel
Warning W8075 ADS1.C 3568: Suspicious pointer conversion in function adsOrderInfo
Error E2451 ADS1.C 3573: Undefined symbol 'DBOI_RELKEYPOS' in function adsOrderInfo
Error E2172 ADS1.C 3573: Duplicate case in function adsOrderInfo
Error E2379 ADS1.C 3575: Statement missing ; in function adsOrderInfo
Warning W8075 ADS1.C 3637: Suspicious pointer conversion in function adsOrderInfo
Warning W8075 ADS1.C 3698: Suspicious pointer conversion in function adsOrderInfo
Error E2451 ADS1.C 3771: Undefined symbol 'DBOI_SCOPESET' in function adsOrderInfo
Error E2172 ADS1.C 3771: Duplicate case in function adsOrderInfo
Warning W8019 ADS1.C 3773: Code has no effect in function adsOrderInfo
Error E2379 ADS1.C 3773: Statement missing ; in function adsOrderInfo
Error E2451 ADS1.C 3816: Undefined symbol 'DBOI_SCOPECLEAR' in function adsOrderInfo
Error E2172 ADS1.C 3816: Duplicate case in function adsOrderInfo
Error E2228 ADS1.C 3816: Too many error or warning messages in function adsOrderInfo
*** 26 errors in Compile ***

** error 1 ** deleting ..\obj\b32\ads1.obj
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Fri Jan 06, 2006 1:34 am

More info. I found a much older version of adsfunc.c and it does contain the adsconnect60() function. So, I am confused as to why I am getting the link errror:

Error: Unresolved external '_HB_FUN_ADSCONNECT60'

When the function is in the lib and the lib is being linked. I have confirmed that the lib is being linked because if I leave it out of the link script then I get a lot more errors.

I guess logic would say that it may be in the adsfunc.c program, but it is not in the rddads.lib. Is there a way to view the functions in a lib?

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

Postby Antonio Linares » Fri Jan 06, 2006 7:32 am

James,

Why don't you use the rddads.lib file that comes into www.fivetechsoft.com/files/harbour.exe ?
regards, saludos

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

Postby James Bott » Fri Jan 06, 2006 7:47 am

Why don't you use the rddads.lib file that comes into www.fivetechsoft.com/files/harbour.exe ?


I was using the one that came with FWH 2.6. I listed the functions using "tlib rddads.lib, rddads.txt" and there is no function adsconnection60() in it.

I find this curious since the source for adsfunc.c that is older than the lib contains that function, and the source that I have dated last month also has it. But the lib doesn't.

I downloaded the new one and the function is not in it either. I must be misunderstanding something. The source has this in it:

HB_FUNC( ADSCONNECT60 )

Is that not the adsconnect60() function? If so, then the lib must have been created using a different source.

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

Postby reinaldocrespo » Fri Jan 06, 2006 3:51 pm

James;

adsconnect60 is in adsfunc.c. Do notice the order of parameters, and it returns true or false and not a connection handle anywhere. The connection handle is stored on a static variable available internally to any future ads function call that needs it.

I found advantage database documentation to be helpful. You must, however, always check the .c source for the order of parameters.

If you can't find your way around teh adsconnect60 problem, try using adsconnect(...).

HB_FUNC( ADSCONNECT60 )
{

UNSIGNED32 ulRetVal ;
UNSIGNED8 *pucServerPath = (UNSIGNED8 *) hb_parcx( 1 );
UNSIGNED16 usServerTypes = ( UNSIGNED16 ) hb_parni( 2 );
UNSIGNED8 *pucUserName = ISCHAR( 3 ) ? (UNSIGNED8 *) hb_parcx( 3 ) : NULL ;
UNSIGNED8 *pucPassword = ISCHAR( 4 ) ? (UNSIGNED8 *) hb_parcx( 4 ) : NULL ;
UNSIGNED32 ulOptions = ISNUM( 5 ) ? hb_parnl( 5 ) : ADS_DEFAULT ;

ulRetVal = AdsConnect60( pucServerPath,
usServerTypes,
pucUserName,
pucPassword,
ulOptions,
&adsConnectHandle );

if(ulRetVal == AE_SUCCESS )
{
hb_retl( 1 ) ;
}
else
{
hb_retl( 0 ) ;
}

}
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby James Bott » Fri Jan 06, 2006 4:41 pm

Reinaldo,

I just copied the line from Rene's demo;

IF AdsConnect60( "\\googleserver\cursos\adsdemo\cibconwn\stc\internet server.add", 4,"demo","demo")

So the problem has nothing to do with parameter passing.

The proplem is that the rddads.lib doesn't not contain the adsconnect60() function, in spite of the fact that I cannot find any copy of adsfunc.c that doesn't have the function in it. Even the newest Harbour's rddads.lib doesn't contain the function.

Since I am unable to compile the source without error, I cannot fix the library. I have emailed Rene directly to see if he can resolve the problem for me.

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

Postby R.F. » Fri Jan 06, 2006 8:17 pm

James:

I got it, I got it, I got it !!!!!!!!

The RDDADS.LIB as it comes built in the contrib directory when you download the binary version (not the source), is designed to work with ADS version 5.x and lower, not for ADS ver 6.x and upper. AdsConnect60 and other functions are not taken in when you compile the source code of the RDDADS AS IS.

You have to recompile the RDDADS.LIB from the source code defining the flag ADS_REQUIRE_VERSION to a value equal or greater than 6.

You can do it using de -d flag of the C compiler or, go straight into the source code of the ADSFUNC.C and remove manually the

#if ADS_REQUIRE_VERSION >=.....

And recompile the library again.
Saludos
R.F.
R.F.
 
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Postby James Bott » Fri Jan 06, 2006 8:52 pm

Rene,

I would have never figured that out!

I couldn't figure out how to use the -d parameter, so I modifed the source (adsfunc.c) as you suggested. However, I am still getting this compile error:

Error E2139 rddads.h 96: Declaration missing ;

Here is how I am calling the compiler:

c:\bcc55\bin\bcc32 -c -O2 -DWIN32 -Ic:\harbour\include adsfunc.c

Any ideas?

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests