Page 1 of 1
new user - introduction
Posted: Thu Apr 30, 2020 5:13 pm
by wolfgang.muellauer
hello,
my name is Wolfgang Muellauer.
I am a C# / C++ / XBase programmer and I live in Vienna / Austria.
I have one old but important legacy application written in the 80-ies that I keep running for one customer.
I have been working with Alaska XBase++ 1.90 but as the upgrade to XBase++ 2.00 breaks my application
I started looking for an alternative to Alaska. As I am currently writing all my new apps in C# (mostly WPF - apps)
XSharp would be a perfect fit for me and help me kepp my old codebase alive.
Since yesterday I am a proud FOX and I have already downloaded the 2.4 Compiler and installed it in a VM.
As first step I will try to write some spikes for accessing my Advantage Database Server with the RDD and
then try to move my old code over to XSharp.
I am looking forward to working with this new Development Environment.
Greetings from Vienna
Wolfgang Muellauer
new user - introduction
Posted: Thu Apr 30, 2020 5:49 pm
by robert
Wolfgang,
Welcome!
The ADS RDD is built right into the XSharp.RDD assembly. You do not need to load anything, however the ACE32 (32 bits) or ACE64 (64 bits) files and their support files must be provided by you.
To load data with ADS you set a new default driver
RDDSetDefault("AXDBFNTX") or RDDSetDefault("AXDBFCDX") etc. See
https://www.xsharp.eu/runtimehelp/html/N_Advantage.htm for a list of RDD names.
If you are accessing local files then that is all you need to do.
If you want to login to a remove server then add a reference to XSharp.RDD and call the function AdsConnect60() to specify the database and login info (
https://www.xsharp.eu/runtimehelp/html/ ... nect60.htm) The last parameter is an out parameter that receives the connection handle.
You can then call AX_SetConnectionHandle() and pass that handle. You have to cast the handle to a DWORD before sending it into AX_SetConnectionHandle() . We'll add an overload that takes an intptr in one of the next builds.
Subsequent files that will be opened with one of the advantage RDDs will then use this connection handle.
Robert
new user - introduction
Posted: Fri May 01, 2020 8:58 am
by wriedmann
Hi Robert, hi Wolfgang,
X# works like Clipper when the Advantage RDD is used:
Code: Select all
function Start( ) as void
local cFileName as string
cFileName := "c:cavoworkeasyfaktv3dbfzako.dbf"
cFileName := "x:easyfaktdbfzako.dbf"
DBUseArea( true, "AXDBFCDX", cFileName, "ZAKO", true, true )
ZAKO->( DBGoTop() )
while ! ZAKO->( EoF() )
System.Console.WriteLine( ( string ) ZAKO->ZAKO )
ZAKO->( DBSkip() )
end
ZAKO->( DBCloseArea() )
return
and no AdsConnect60() call is needed if the data is accessed only through the RDD (I have verified on the ADS console that my test application really uses the remote server).
The AdsConnect60() call is only needed when the AdsSqlServer class is used.
Another possibilty to use ADS from X# is the Advantage.Data.Provider.dll that implements a ADO Data provider (my favorite to access legacy ADS data from new applications - mainly Windows services, but also WPF and Windows Forms applications).
Wolfgang
new user - introduction
Posted: Fri May 01, 2020 10:43 am
by lumberjack
Hi Wolfgang,
Wolfgang Muellauer wrote:hello,
my name is Wolfgang Muellauer.
I am a C# / C++ / XBase programmer and I live in Vienna / Austria.
Since yesterday I am a proud FOX and I have already downloaded the 2.4 Compiler and installed it in a VM.
Welcome aboard!
As you can see we get even assistance from the Main Guru himself on these forums. We a great community and will help you as much as possible to ease you into X#. Feel free to post your questions on the forums, you will find a speedy answer quite quickly even for the difficult problems. The impossible ones will take a day or two...
Enjoy and have fun!
X# greetings from Sunny South Africa!