RDDADS.lib for Harbour and Borland

Re: RDDADS.lib for Harbour and Borland

Postby TimStone » Tue Jan 20, 2015 9:08 pm

Can anyone help on this issue ? Is anyone able to download the 7.1 files from the Google site ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2950
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: RDDADS.lib for Harbour and Borland

Postby Antonio Linares » Tue Jan 20, 2015 10:31 pm

regards, saludos

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

Re: RDDADS.lib for Harbour and Borland

Postby TimStone » Tue Jan 20, 2015 11:27 pm

Thank you. I downloaded this, but it is not what I need.

Perhaps I'm just too old to grab onto this whole concept. Antonio, I'm using what you provided for a Harbour build for Microsoft, but it has nothing in there for ADS. Those files are not included.

Right now I link in the Harbour builds for ACE32.lib ( 12/15/2011 ) and RDDADS.lib ( 05/16/2012). My understanding are these were built with Harbour and ADS 9. Thus, ADS 7 and 8 won't work.

I need the same two libs built with Harbour using the ADS 7 files. Reinaldo said just point to the old SDK ... but we are building with Visual C, so don't we need .c code ? Also, since I don't have a build file, I don't know exactly what source files I need, though I believe they would be: ads1.c adsfunc.c adsmgmnt.c ace32.c

The SDK provides an ace32.lib ( 7/9/2004 ) but no c files at all. I have new RDD_ADS files that include ads1.c, adsfunc.c, and adsmgmnt.c but ace32.c is missing. I also have a modified adsfunc.c that was used in building a working xHarbour set of libraries ( that will not work with Harbour / MSVC ). I am assuming ace32.c is what I need to find from ADS 7.

So, if any of you can assist it would be greatly appreciated.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2950
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: RDDADS.lib for Harbour and Borland

Postby Antonio Linares » Wed Jan 21, 2015 4:55 am

Tim,

Here you find the four .C files that have to be compiled with Visual Studio C compiler in order to build rddads.lib:

https://github.com/harbour/core/tree/master/contrib/rddads

In all of then there is a: #include "rddads.h"

and in rddads.h you find: #include "ace.h"

and that ace.h should be the one included in acsdsk for 7.1 that you have downloaded.

Anyhow, first of all, what I would try is to link acesdk\ace32.lib to see if it works fine with your app. Next, build the lib from those 4 files using 7.1 ace.h
regards, saludos

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

Re: RDDADS.lib for Harbour and Borland

Postby Giovany Vecchi » Tue Jan 27, 2015 12:22 am

I recorded seeing again in zip format
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: RDDADS.lib for Harbour and Borland

Postby reinaldocrespo » Tue Jan 27, 2015 2:22 pm

@Tim;

Just FYI- if you are only using the local server (the free version), then you don't really need to re-build rddads.lib for ads version 7 or 8. All you have to do is distribute your app with adsloc32.dll that belongs to version 9, 10 or 11 and that will work with your rddads.lib built for version 9. If, on the other hand, you are working with version 7 of the remote server, then -yes- you will need to rebuild rddads.lib for version 7.

Notice how the .c sources have conditional compiling so that depending on constants declared on the header files, rddads.lib gets build for a specific ads version. At the end of the day, if you are working with the remote server, then you will need to learn how to rebuild rddads.lib for any version using your own c compiler.. The reason I say this is because Sybase lost interest on the (x)harbour community a few years ago after attempting to reach out at us only to find zero interest. Thus I would not expect them to maintain our .c source nor even get involved on building rddads.lib for each c compiler for each version of the server.

If it helps at all, I will post a reply on this same thread with details you need to know to use ADS including how to build rddads.lib


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

Re: RDDADS.lib for Harbour and Borland

Postby reinaldocrespo » Tue Jan 27, 2015 2:29 pm

Building rddads.lib:

Given a choice of SQL engine to use when building apps from any xbase language, I just can’t think why would anyone choose any other than Sybase’s ADS. I base my assertion on the premise that the apps being built are commercial-multi-user-complex-real-life systems to be used by many users concurrently and on the fact that ADS is the only SQL that is also ISAM.

As xbase programmers we are used to working with indexed dbf tables where a file pointer moves to a specific location granting access to a specific record. Dbf tables and indexes are so simple to manage, we never think on the need to have a DBA on-site or any sort of special maintenance rituals to keep our database healthy. The beauty of ADS is that you get to keep all that while adding SQL to the equation. Certain data operations are better performed with SQL while others are better suited for ISAM. With ADS you are not restricted to just SQL or just ISAM. You have both.

There is, however, one caveat; albeit ADS’s documentation is extensive and very complete, there is close to zero documentation aimed at the xbase programmer. I think the one question I find most often on the forums is how to build Harbour’s replaceable database driver (rddads.lib) for a particular version of ADS. Some times I wonder how many people have been turned off after not being able to even start testing the free ADS local server version. So, let’s start by showing how to build rddads.lib for (x)Harbour for a particular ADS version.

What is ace32, why do I need it and why does it change:

Advantage Client Engine (Ace32.dll) is Sybase’ API to ADS. We will be calling many of these external functions from our Harbour apps. In order for the Linker to resolve references to external functions, like the ones in ace32.dll, we must provide a .lib file format of the .dll file that contains the actual functions as part of our link script. ACE32 is distributed by Sybase and it can be found after installing Data Architect in “c:\program files\Advantage 10.0\ARC\ace32.dll” or after installing the Advantage SDK available for download at http://devzone.advantagedatabase.com.

Each C compiler has its own utility to create a .lib from a .dll. With Borland C++, the most widely used C compiler in the community, that utility is called "implib.exe" and it can be found on \bin directory of the BCC compiler. To create the actual .lib file implib is executed like this: Implib ace32.lib ace32.dll. The command will generate ace32.lib from ace32.dll. Once the .lib file has been created, it must be linked to the application that makes use of the dynamic linked library functions. With the commercial version of xharbour (xhb builder), you need to link ads.lib which is provided in the /lib directory. With the non-commercial version, link ace32.lib as well as rddads.lib which is located in /contrib/rdd_ads.

What you will need to build your own rddads.lib and why:

From time to time Sybase will release a new update of ADS that requires newer clients. While older clients are always compatible with newer servers the opposite is not true. It should be noted that it is not always desirable to stay with old clients. Newer servers introduce new functionality and services that are only available with the corresponding new client. Thus, it may be necessary to build different versions of the ADS libs (rddads.lib and ace32.lib) to be linked to the Harbour application depending on the ADS server and client being targeted. To build rddads.lib the developer needs to acquire ace.h for the ADS version for which the .lib is to be created i.e. (ADS version 7, 8, 9...). This file can be found on the Advantage SDK which is available for download from the advantage client engine link found in http://devzone.advantagedatabase.com or in the \rdd_ads directory inside \xharbour\contrib directory. Please note that the SDK will also contain ace32.dll which we need to create ace32.lib. Ace.h is the only version specific file to be used when building rddads.lib. It is crucial that the correct ace.h is used and it should be the one that corresponds to the advantage .dll files and ADS version being targeted.

Building rddads.lib:

More than once the Harbour project developers have changed the method necessary to build an ADS version specific rddads.lib. At this point I take for granted that the reader is using more recent versions of the compiler; e.i. 2009 or newer. I will reserve for a later post how to build rddads.lib for older versions of the compiler.

Starting with version 1.2 of the xharbour compiler, the Harbour project developers have put a new system in place to automatically get everything set up in order to build \xharbour\lib\rddads.lib as well as ads32.lib for any specific version and it works quite well. Let me just say that it represents a huge improvement over previous methods. It requires acesdk directory for the specific ADS version. Acesdk is installed from aceapi.exe which can be downloaded from the advantage devzone as noted previously.

Once acdsdk has been installed, set the environmental variable HB_DIR_ADS to the directory that contains the SDK files:

C:\xharbour\contrib\rddasd>set HB_DIR_ADS=c:\ads8\acesdk

Now execute the batch file for the C compiler being used with your applications and the newly created rddads.lib and ace32.lib necessary to be linked to your Harbour apps will be found in c:\xharbour\lib. Note that the batch files used to build the lib file are written for specific compilers (make_b32.bat for Borland c++, make_vc.bat for MS Visual c). You might have to edit the makefile (makefile.bc for Borland c++ or makefile.vc for MS Visual c) to make sure the paths are correct.

Distributing an Advantage Enabled Application

Include the files below with your distribution of a Windows Harbour Advantage client application:

ace32.dll: Advantage Client Engine DLL. This .dll contains the core Advantage Windows client functionality.

adsloc32.dll: Advantage Local Server DLL. This .dll contains the core local server functionality. This file is not necessary if using the Advantage Database Server only.

adslocal.cfg: Advantage Local Server configuration file. This file is only necessary if using the Advantage Local Server and you wish to use Local Server settings other than the default.

ansi.chr: This file is needed for ANSI language support with the Advantage Local Server. This file may only be necessary if using non-English ANSI character sets with the Advantage Local Server.

axcws32.dll: Advantage remote communication library used when accessing data via the Advantage Database Server -Remote as well as Internet connections. This file is not necessary if using the Advantage Local Server only.

extend.chr: This file is needed for international OEM language support with the Advantage Local Server. This file is only necessary if using non-USA OEM character sets with the Advantage Local Server.

Remote, Internet, Local Advantage Connections

If you are wondering what is the difference between Remote, Internet, and Local servers, read this section. I borrow some of it from the ADS help files. The help files are available from ARC or from http://devzone.advantagedatabase.com (and it is quite good).

With Advantage there are three different ways to connect to data:

. Advantage Local Server (ALS).
. Advantage Database Server in a two tier mode (Client-Server).
. Advantage Internet Server (AIS).
AIS: Advantage can establish a secure connection between remote locations through basic Internet connections. Using an Advantage Internet connection provides both encryption and compression. When the connection is done via the Internet then it is referred to as an Advantage Internet Server (AIS) connection (**not a remote connection as logically you might conclude**). This requires configuring an Internet port and opening that port within the firewall at the server end as well as the client's end. With the Advantage Internet Server, a developer can have a truly Internet-enabled application without any code changes. This simple, non-HTML solution is incorporated into the Advantage Database Server so that the Internet can be used as its own virtual private network. Be advised that Internet connections tend to be slower than a regular LAN connection, thus certain ways to display data might need to be avoided.

Remote: Do not confuse the term "Advantage Remote Connection" with an internet connection to the data on the server. With ADS, a Remote connection is really the LAN connection to an actual ADS server, i.e. a two tier -Client-Server system connecting via tcp or udp without the use of the Internet. When using Remote connections, there is no need to share the data directory that contains the actual dbf/adt tables for an Advantage enabled application to access this data. This is one of the security features of ADS using server-side aliasing which we will discuss on the later part of this document.

The Advantage Database Server is the key to improved database performance in network environments. The server acts as an intelligent controller that reduces competition for resources and off-loads much of the work normally performed by each client workstation. It is responsible for all database access, including all reading and writing of data, and lock management. Working with the network operating system, the Advantage Database Server processes data requests and returns the information to the network clients.

The Advantage Database Server supports the NetWare, Windows, and Linux operating systems. The Advantage Database Server for NetWare is implemented as a NetWare Loadable Module (NLM). The Advantage Database Server for Windows operates as a Windows Service. The Advantage Database Server for Linux runs as Linux daemon service. The Remote and AIS client code used by an Harbour client application compiled to run under Windows is axcws32.dll. The Remote and AIS code used by an Harbour client application compiled to run under Linux is a shared object named libads.so.

ALS: The Advantage Local Server allows Advantage applications access to data files located locally, in shared environments, or in peer-to-peer environments. The Advantage Local Server is a non-client/server solution and can be used to access data on the local computer or on a shared file server that is not running the Advantage Database Server service.

The Advantage Local Server is called directly by the Advantage Client Engine, both of which exist as either Windows DLLs or Linux shared objects. If the data files exist on a local workstation, no network connection is necessary nor is network communication used between the Advantage client and the Advantage Local Server.

There is no cost for the Advantage Local Server. The Advantage Local Server is installed with all Advantage Windows and Linux client products (which are also free). With ALS you may develop applications for single and multi-user environments and distribute them royalty-free.

The Windows version of the Advantage Local Server (ALS) is a DLL named ADSLOC32.DLL. The Linux version of the Advantage Local Server is a shared object named libadsloc.so. The Advantage Local Server allows both single-user and multiple-user access to data files. Note however that the Advantage Local Server file that is installed with Advantage client products contains a physical limitation such that only five or fewer users can concurrently access any table.

One drawback of ALS is the lack of "transaction processing". A second drawback is the fact that the ALS "client" works in the same thread with the ALS "server", waiting one for another as it would if the data was stored locally on the client machine. In this scenario the server only acts as a file sharing disk to multiple workstations pulling data across the network. But then again, this is exactly how any other Harbour RDD works.

What makes ALS very attractive is that you may distribute your application to smaller customers without the ADS server and when the customer grows in the number of users, or requires greater security and speed, or cannot tolerate the possibility of data/index corruption due to a workstation unexpected crash, then for a small price you may deploy the ADS remote server while not even having to recompile your application.

In my next posts I will show some of the advantages of ADS over any other native xbase RDD and how to start taking advantage of it.



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

Re: RDDADS.lib for Harbour and Borland

Postby Carles » Tue Jan 27, 2015 8:51 pm

Reinaldo,

You will be the next president of sybase. ;). Thanks for your opinion, I love it. I still remember discussions with Mr. Nages about ads, years ago -> viewtopic.php?f=3&t=9343#p85272 . Ads is and will be a good solution.
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Carles
 
Posts: 1143
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Re: RDDADS.lib for Harbour and Borland

Postby D.Fernandez » Wed Jan 28, 2015 5:31 pm

Reinaldo: Excellent explanation.

I really want to use ADS, but from the beginning, whit .add.
I'd just translate your post to Spanish and I believe that it's great.

Waiting for more... :D

Thank you very much.

Best regards
Ruben Dario Fernandez.
Dario Fernandez
FWH 24.09, Harbour, MVS2022 Community, BCC, MySql & MariaDB, Dbf/Cdx VSCode.
Maldonado - Uruguay
D.Fernandez
 
Posts: 492
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay

Re: RDDADS.lib for Harbour and Borland

Postby Antonio Linares » Thu Jan 29, 2015 1:35 am

Dear Reinaldo,

Could you please help Yessica here ?

viewtopic.php?p=171460#p171460

thanks
regards, saludos

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

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