ADS
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
ADS
I recently downloaded a sample app from René's web site. When executed it connects to remote dbfs and allows add/edit/view/browse of tables (DBFs). It is a very convinient solution to provide clients access to one common database from many remote work stations via a fast web connection, and still use the same xbase we know. It uses the ADS client-server add-on which is not exactly inexpensive, but seems to works great nevertheless.
I thought it would make great sense to gear my apps towards using the ADS drivers so that whenever remote access is needed, it will only be a matter of purchasing and installing the ADS server at the customer's server where the dbfs are stored. We must admit that it is becomming increasingly more crucial to have web/enabled or remotely/web accessed apps now days.
In order to have one and only one set of source code to work with the local server as well as with the commercial n users server stuff, I thought of placing a flag on a .ini file that will decide wheather the app is to work with a local or remote server. Something sort of like this:
INI oIni FILE ".\MyApp.ini"
Get xRDD SECTION "RDD" ENTRY "RDD-VERSION" OF oIni DEFAULT "LOCAL"
ENDINI
rddsetdefault( "ADS" )
rddRegister ( "ADS", 1 )
SET FILETYPE to NTX
IF upper( xRDD ) <> "LOCAL"
SET SERVER REMOTE
cADS := " Remote 32 bit -b"
ELSE
cADS := " Local 32 bit -b"
SET SERVER LOCAL
ENDIF
and always link the ads RDDs.
Questions:
1. Will this work?
2. Is there a better way?
3. Exactly what files must be linked?
4. I once read that there is a free ADS 2 user full version available. How can it be obtained?
BTW; Last night I accidentally also came across a web-radio transmission via a posting about radio creswin from Méjico. René was on the air speaking about ADS. It was a very pleasant converstion. Congratulations on the radio program. I'm only sory I was late on it and did not get to listen to the whole transmission. Does any body know the scheduling of this program on the air? I'm looking forward to listening anytime I'm able to.
Best,
Reinaldo Crespo-Bazán
I thought it would make great sense to gear my apps towards using the ADS drivers so that whenever remote access is needed, it will only be a matter of purchasing and installing the ADS server at the customer's server where the dbfs are stored. We must admit that it is becomming increasingly more crucial to have web/enabled or remotely/web accessed apps now days.
In order to have one and only one set of source code to work with the local server as well as with the commercial n users server stuff, I thought of placing a flag on a .ini file that will decide wheather the app is to work with a local or remote server. Something sort of like this:
INI oIni FILE ".\MyApp.ini"
Get xRDD SECTION "RDD" ENTRY "RDD-VERSION" OF oIni DEFAULT "LOCAL"
ENDINI
rddsetdefault( "ADS" )
rddRegister ( "ADS", 1 )
SET FILETYPE to NTX
IF upper( xRDD ) <> "LOCAL"
SET SERVER REMOTE
cADS := " Remote 32 bit -b"
ELSE
cADS := " Local 32 bit -b"
SET SERVER LOCAL
ENDIF
and always link the ads RDDs.
Questions:
1. Will this work?
2. Is there a better way?
3. Exactly what files must be linked?
4. I once read that there is a free ADS 2 user full version available. How can it be obtained?
BTW; Last night I accidentally also came across a web-radio transmission via a posting about radio creswin from Méjico. René was on the air speaking about ADS. It was a very pleasant converstion. Congratulations on the radio program. I'm only sory I was late on it and did not get to listen to the whole transmission. Does any body know the scheduling of this program on the air? I'm looking forward to listening anytime I'm able to.
Best,
Reinaldo Crespo-Bazán
Good to know you have tested our programs.
And since you liked the talk about ADS, you can download some other interviews regarding MySQL, xHarbour.com, 32 bits migration, from here:
www.listoelpollo.blogspot.com
All the interviews are recorded in MP3 format so you can download them and listen anytime you want.
Now let's go to ADS:
you will need the following DLLs
AXWCS32.DLL : ADS client
ACE32.DLL : DLL with all the ADS functions.
Optional:
ADSLOC32.DLL for you to use the "local Server".
These DLLs are provided by Advantage in its programa Advantage Data Architech, you can download the ARC from our website:
www.google.d2g.com/ads/arc32.exe
If using a remote server or the internet server you will need:
ADS.INI
If using local server you will also need :
ADSLOC.CFG
For the source code you will need:
RDDADS.LIB
ACE32.LIB.
Now, let's go piece by piece.
(x)Harbour provides you with the RDDADS.LIB (it's in the contributions section), this file contains wrappers to the most common used ADS functions. These functions are stored in a DLL called ACE32.DLL (Advantage Client Engine), the fastest way to use the ACE32 is to "export" all the functions into a LIB file, this can be done using a program included in the Borland C++ compiler called IMPLIB.EXE, you simply do:
IMPLIB ACE32.LIB ACE32.DLL
this will convert the DLL into a harbour linkable LIB. however there are certain resources in the DLL that cannot be exported into a lib, so you will need to distribute the ACE32.DLL no matter that you have converted it into a lib.
You must link these both files in your (x)harbour program.
Along with this, you should include the ADS client itself, which is: AXWCS32.DLL this client is used to log into the 3 servers, Remote, local and internet. This file requieres the ADS.INI file to define the LAN IP for the remote server and the WAN IP for the internet conection.
In your code, there's no need to do much things, instead choosing the server by hand, simply:
AdsSetServerType(7)
This will "activate" the "smart server searching", this means that you programa automatically detect what kind of server you are using, and will connect to it with no intervention at all. However, the parameter in the AdsSetServerType() defines what kind of server you will use
1 - Local Server
2 - Remote Server
4 - Internet Server
You can add the values to make different server combinations, for example:
3 - Local and Remote Server
5 - Local and Internet Server
6 - Remote and Internet Server
7 - Local, Remote and Internet Server
so, theres no need to have anything extra.
And since you liked the talk about ADS, you can download some other interviews regarding MySQL, xHarbour.com, 32 bits migration, from here:
www.listoelpollo.blogspot.com
All the interviews are recorded in MP3 format so you can download them and listen anytime you want.
Now let's go to ADS:
you will need the following DLLs
AXWCS32.DLL : ADS client
ACE32.DLL : DLL with all the ADS functions.
Optional:
ADSLOC32.DLL for you to use the "local Server".
These DLLs are provided by Advantage in its programa Advantage Data Architech, you can download the ARC from our website:
www.google.d2g.com/ads/arc32.exe
If using a remote server or the internet server you will need:
ADS.INI
If using local server you will also need :
ADSLOC.CFG
For the source code you will need:
RDDADS.LIB
ACE32.LIB.
Now, let's go piece by piece.
(x)Harbour provides you with the RDDADS.LIB (it's in the contributions section), this file contains wrappers to the most common used ADS functions. These functions are stored in a DLL called ACE32.DLL (Advantage Client Engine), the fastest way to use the ACE32 is to "export" all the functions into a LIB file, this can be done using a program included in the Borland C++ compiler called IMPLIB.EXE, you simply do:
IMPLIB ACE32.LIB ACE32.DLL
this will convert the DLL into a harbour linkable LIB. however there are certain resources in the DLL that cannot be exported into a lib, so you will need to distribute the ACE32.DLL no matter that you have converted it into a lib.
You must link these both files in your (x)harbour program.
Along with this, you should include the ADS client itself, which is: AXWCS32.DLL this client is used to log into the 3 servers, Remote, local and internet. This file requieres the ADS.INI file to define the LAN IP for the remote server and the WAN IP for the internet conection.
In your code, there's no need to do much things, instead choosing the server by hand, simply:
AdsSetServerType(7)
This will "activate" the "smart server searching", this means that you programa automatically detect what kind of server you are using, and will connect to it with no intervention at all. However, the parameter in the AdsSetServerType() defines what kind of server you will use
1 - Local Server
2 - Remote Server
4 - Internet Server
You can add the values to make different server combinations, for example:
3 - Local and Remote Server
5 - Local and Internet Server
6 - Remote and Internet Server
7 - Local, Remote and Internet Server
so, theres no need to have anything extra.
Saludos
R.F.
R.F.
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
Rene;
Thank you very much for your answer and quick guide. I think that you and "listoelpollo" with the radio program do a great service. I continue to write English for the benefit of the rest of the ng.
I did as you said. It all went well. I got one of my apps to work with the ADS RDDs LOCAL server and still use the same sets of DBF-NTX files. Up to this point I encountered no problems and the app works as expected. I'm wound up about it.
So I decided to download the free trial ADS version for Linux. I'm using SAMBA services to access the data from windows XP workstations. I installed it and changed the directory where the data is stored ownership as performed by the installation routine. But now my app does not have access to the data. It stoped working. I know I could chmod and chown back to what it was and my app will again have access to the files, but I'm afraid it would not be working with the REMOTE server. AMOF, by leaving the permissions as set to "advantage.users" rwxr--r--, is the only way I know for sure that the application is working with the remote server. --Right?
Below is the piece of code where the SET SERVER happens:
INI oIni FILE ".\MyApp.ini"
Get xRDD SECTION "RDD" ENTRY "RDD-VERSION" OF oIni DEFAULT "LOCAL"
...
rddsetdefault( "ADS" )
SET FILETYPE to NTX
rddRegister ( "ADS", 1 )
AdsSetServerType( 7 ) //iif( xRDD == "REMOTE", 2, 1 ) )
I thought with AdsSetServerType( 7 ) it would automatically connect to the REMOTE server if found. Well..., it did not.
The ADS deamon is up and running. I confirmed this with ps -aux. It has a ps ID of 556.
I'm stuck at this point. Please help!
Again, thank you very much.
Reinaldo.
Thank you very much for your answer and quick guide. I think that you and "listoelpollo" with the radio program do a great service. I continue to write English for the benefit of the rest of the ng.
I did as you said. It all went well. I got one of my apps to work with the ADS RDDs LOCAL server and still use the same sets of DBF-NTX files. Up to this point I encountered no problems and the app works as expected. I'm wound up about it.
So I decided to download the free trial ADS version for Linux. I'm using SAMBA services to access the data from windows XP workstations. I installed it and changed the directory where the data is stored ownership as performed by the installation routine. But now my app does not have access to the data. It stoped working. I know I could chmod and chown back to what it was and my app will again have access to the files, but I'm afraid it would not be working with the REMOTE server. AMOF, by leaving the permissions as set to "advantage.users" rwxr--r--, is the only way I know for sure that the application is working with the remote server. --Right?
Below is the piece of code where the SET SERVER happens:
INI oIni FILE ".\MyApp.ini"
Get xRDD SECTION "RDD" ENTRY "RDD-VERSION" OF oIni DEFAULT "LOCAL"
...
rddsetdefault( "ADS" )
SET FILETYPE to NTX
rddRegister ( "ADS", 1 )
AdsSetServerType( 7 ) //iif( xRDD == "REMOTE", 2, 1 ) )
I thought with AdsSetServerType( 7 ) it would automatically connect to the REMOTE server if found. Well..., it did not.
The ADS deamon is up and running. I confirmed this with ps -aux. It has a ps ID of 556.
I'm stuck at this point. Please help!
Again, thank you very much.
Reinaldo.
Reinaldo:
ADS daemon for Linux has a great misadvantage.... is a real PITA (pain in the....ss) to get it configured correctly.
The last ADS for linux I installed took me over 3 days making tests until I dunno what I did that it started working under samba.
You may check if you have a successful installation if you install the ARC and using the tools included in the main menu you can check that you have a response of the Linux server.
If so... let us know what you did to install the server
ADS daemon for Linux has a great misadvantage.... is a real PITA (pain in the....ss) to get it configured correctly.
The last ADS for linux I installed took me over 3 days making tests until I dunno what I did that it started working under samba.
You may check if you have a successful installation if you install the ARC and using the tools included in the main menu you can check that you have a response of the Linux server.
If so... let us know what you did to install the server
Saludos
R.F.
R.F.
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
I got it to work! Yea!
Don't ask me how. I'm too new at the ADS matter to know exactly what did the trick. Perhaps it is too simple to even discuss it here. But the important thing is that I got it work. Now I move into more and more tests...
Marcelo;
You make quite an interesting point. As I think about it; hum..., I realize that indeed we should not really need SAMBA after all. I'll be testing this also. But first, there are too many other things to do. To start with, I'm going to have to change all my file names (hundreds) to lowercase (will probably write a script to do so). After this I'll be testing with AIS connection and speed of transactions. Allowing access to the dbfs from anywhere via a web connection is very important to me.
I'll keep you all informed. Thank you for all your comments and help.
Don't ask me how. I'm too new at the ADS matter to know exactly what did the trick. Perhaps it is too simple to even discuss it here. But the important thing is that I got it work. Now I move into more and more tests...
Marcelo;
You make quite an interesting point. As I think about it; hum..., I realize that indeed we should not really need SAMBA after all. I'll be testing this also. But first, there are too many other things to do. To start with, I'm going to have to change all my file names (hundreds) to lowercase (will probably write a script to do so). After this I'll be testing with AIS connection and speed of transactions. Allowing access to the dbfs from anywhere via a web connection is very important to me.
I'll keep you all informed. Thank you for all your comments and help.
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
Reinaldo,
I am happy that is working for you, I recomend to you to port your DBF file to ADT, with ADS ADT is more stable. Another good think, is that you can mix SQL with traditional dbf table navegation, yes this is possible with DBF too .
You don't have problems to work with AIS from ADS/Linux, I made some test to connect to my Linux server from Mexico (Mauricio Bernal) and this work, I have a PHP interface too, but configure and compile the PHP was hard, I hope Extend System change this in the new version (8.0)
Regards
Marcelo
P.D. a stupid script to change files in the current directory lo lowercase
#!/bin/sh
for i in `ls`
do
lc=`echo $i | tr A-Z a-z`
mv $i $lc
done
I am happy that is working for you, I recomend to you to port your DBF file to ADT, with ADS ADT is more stable. Another good think, is that you can mix SQL with traditional dbf table navegation, yes this is possible with DBF too .
You don't have problems to work with AIS from ADS/Linux, I made some test to connect to my Linux server from Mexico (Mauricio Bernal) and this work, I have a PHP interface too, but configure and compile the PHP was hard, I hope Extend System change this in the new version (8.0)
Regards
Marcelo
P.D. a stupid script to change files in the current directory lo lowercase
#!/bin/sh
for i in `ls`
do
lc=`echo $i | tr A-Z a-z`
mv $i $lc
done
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
Maximus,
tienes tomar en cuenta que para conectarte a una tabla que esta en linux, debes de colocar todo el path, es decir si tienes corriendo ADS en una maquina con IP 192.168.1.10 en el puerto 3000 y tus archivos estas en /var/ads/data, entonces podrias poner
SET DEFAULT TO \\192.168.1.10:3000\var/ads/data
Espero te sirva.
saludos
Marcelo
tienes tomar en cuenta que para conectarte a una tabla que esta en linux, debes de colocar todo el path, es decir si tienes corriendo ADS en una maquina con IP 192.168.1.10 en el puerto 3000 y tus archivos estas en /var/ads/data, entonces podrias poner
SET DEFAULT TO \\192.168.1.10:3000\var/ads/data
Espero te sirva.
saludos
Marcelo
Maximus wrote:saludos , tengo el ADS instalado en mi Servidor Linux y todos las pruebas de conexion funcionan perfecto pero..
cuando intento conectarme desde mi programa me marca error que no encuentra la dbf...
alguna sugerencia.
saludos
Maximus
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia