by R.F. » Tue Oct 31, 2006 4:58 am
That's my area of expertise:
AIS (Advantage Internet Server) is a little complicate to understand but it works the way you want, what you need is:
1) a Data dictionary to validate the remote users (See the ARC manual to do this), you have to setup new users, and your tables within the same dictionary, you have also to enable internet access to both, dictionary and users.
2) In the advantage configuration utility you have to assign a port for the internet server and a compresion of the data, do so in your server.
3) You have to open and forward the same port established in the previous step in your router to your internal server.
4) In your code, you have to set the server type to 7, this way the same application will run in your LAN or in internet, depending of the first available server (AdsSetServerType(7)).
5) In your code, you have to connect to the remote server using the AdsConnect60() function, passing this parameters:
AdsConnect60("\\server\share\folder\dictionary.add",7,"user","password")
please notice that you have to connect to the dictionary using the UNC, thi s UNC will be solved in the next step.
6) In you code, remove the reference to the path when opening databases, once you have registered the table in the dictionary, you not longer need the path to open.
7 ) How does ADS knows where is the server, or who ADS knows that the server is running over internet ?, very easy, ADS uses a configuration file called ADS.INI that must exist in the same directory where the AXCWS32.DLL is, this ADS.INI file looks like this
[server]
INTERNET_IP= 200.67.37.111
INTERNET_PORT=whatever.
the entry "server" is where the ADS must look for the public IP, so any reference in your code inthe URL for \\server will point to the internet server.
Example:
In you code:
AdsConnect60("\\server\cursos\adsdemo\stc\dic.add",7,"demo","demo")
In the ADS.INI
[googleserver]
INTERNET_IP=google.d2g.com
INTERNET_PORT=2000
Please check samples of AIS
Don't hesitate on contactme to my private mail if you want further information.
Saludos
R.F.