Page 1 of 1

Free tables and Advantage Internet Server (AIS)

PostPosted: Wed Nov 11, 2009 3:51 pm
by modicr
Hello!

Currently I use free Advantage Database Local DLL files for accessing DBF-s from our applications. Now I wish to access them via Internet (ADSL). I installed the latest ADS 9.10.0.9 and changed the line SET SERVER LOCAL to SET SERVER REMOTE and tested our simple application and it was working OK. In the next step I created Advantage Data Dictionary file (C:\AAPL\ADSTEST.ADD) using the latest Advantage Data Architect and changed the line SET SERVER REMOTE to AdsSetServerType(ADS_AIS_SERVER). I also added the following code:

xRDDPath := 'c:\aapl\'
cDict:='adstest.add'
G_Msg('Povezovanje preko interneta ... ' + xRDDPath + cDict)
if AdsConnect60( xRDDPath + cDict, ADS_AIS_SERVER, "ADSSYS")
   ...


I also shared volume C: as ADS91 with full access and changed ADS.INI on client machine:

[MASTERM1]
INTERNET_IP=192.168.1.101
INTERNET_PORT=50101

[DRIVES]
C:=\\MASTERM1\ADS91


In Data Dictionary I enabled "Internet Access" on security tab and allowed non-password users... User ADSSYS was also set to have internet access ...
I temporarily disabled firewall ...

Now the function AdsConnect60 returns .T. so it seems that connection is working OK, but when our app tries to open DBF (we use full path for example: C:\AAPL\ADST\DAT\PRVA.DBF), we receive an error.
BTW, I would like to use free tables because tipically our app opens DBFs in tree different subfolders inside C:\AAPL.

How do you open DBF via AIS?

Thanks, Roman

P.S. Here is quote from ADS help file:
To use the new Internet functionality you will need to create a data dictionary. The Internet server will use the data dictionary to validate users. Free Tables (tables not in a Data Dictionary) can be opened through an Internet connection. To deny a user’s rights to a table, the table needs to be added to the Data Dictionary and the user’s rights removed from the table.

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Thu Nov 12, 2009 12:37 am
by TimStone
AIS is not supported with LOCALSERVER. You have to buy the product to use it. You can get details at Advantage website.

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Thu Nov 12, 2009 2:16 am
by fraxzi
Hi,

I hope this helps.

1. No need to share 'C:' or any folder.
2. create adsserver.ini and put to path with 'error and assert log path' usualy 'C:' partition
on your adsserver.ini contains:
Code: Select all  Expand view

    [ServerAliases]
     yourdataDD = c:\yourdatafolder     //the location of your remote .add and tables
   

3. on your ads.ini (client side)
Code: Select all  Expand view

    [Settings]
    ADS_SERVER_TYPE = 6         //this is AIS and REMOTE  (4 + 2)
    COMPRESSION = Always
   


4. If AdsConnect60(\\<ip address>:<port>\yourdataDD\your.ADD, ADS_AIS_SERVER, 'adssys',,,@hADS ) == .T. //means connected to your .add
5. open table as usual 'use table' //where table is added to your .add

note: don't forget to enable internet access to your .add user or to 'adssys'


Enjoy the server side alias of ADS. no need to share folder. Secured and Fast.


Regards,
Fraxzi

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Tue Nov 17, 2009 11:28 am
by modicr
Hello!

Thanks for hint about adsserver.ini - that's very useful.
My ADSSERVER.INI
[ServerAliases]
C_AAPL = C:\AAPL


I've added the table to the .ADD and I was able to open it and write to it via Internet :lol:
(my ADD "path" is now "\\192.168.1.16:52216\c_aapl\")

use druga
G_Msg(DRUGA->PRVA_ID)
DRUGA->PRVA_OPIS := AllTrim(DRUGA->PRVA_OPIS)+" T"
G_Msg(DRUGA->PRVA_OPIS)


But it would be great if I could open DBF tables via AIS without adding them to the .ADD.
I've tried with

use "\\192.168.1.16:52216\c_aapl\ads91\dat\prva.dbf" alias PRVA1


but it returns error ADSCDX/5132: AE_INVALID_OBJECT_NAME (The specified database object name is not valid.)

BTW, is it possible to add and remove tables from .ADD programmaticaly via Harbour/FWH?

Thanks, Roman

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Tue Nov 17, 2009 11:37 am
by modicr
Hello!

TimStone wrote:AIS is not supported with LOCALSERVER. You have to buy the product to use it. You can get details at Advantage website.


I'm using 30-day trial of ADS 9.1: http://marketing.ianywhere.com/forms/ADS91-30-Day

Regards, Roman

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Tue Nov 17, 2009 3:27 pm
by modicr
One more question: How can I use AdsOpenTable in Harbour/FWH?
I can find this function both in rddads.lib and ace32.lib, but when I try to link it with my app, I
receive an error: Unresolved external '_HB_FUN_ADSOPENTABLE'. It seems that it is not implemented (yet) ...

Thanks, Roman

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Thu Nov 19, 2009 4:05 am
by fraxzi
Yes you can add table to .ADD programaticaly.

1. delete the existing alias from your .ADD using :
Code: Select all  Expand view

 AdsDDRemoveTable( 'your alias',,,hADSHandle )   //=>lSuccess, but return doesn't matter.
 


2. add your table (assuming the table is in your C:\AAPL )
Code: Select all  Expand view

AdsDDAddTable( 'your alias', 'table path'+'table',, hADSHandle )  //=> lSuccess
 


3. Open it simple as this:
Code: Select all  Expand view

 use table alias youralias shared
 



Good Luck!

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Thu Nov 19, 2009 5:50 pm
by modicr
Hello!

fraxzi wrote:Yes you can add table to .ADD programaticaly.

1. delete the existing alias from your .ADD using :
Code: Select all  Expand view

 AdsDDRemoveTable( 'your alias',,,hADSHandle )   //=>lSuccess, but return doesn't matter.
 


2. add your table (assuming the table is in your C:\AAPL )
Code: Select all  Expand view

AdsDDAddTable( 'your alias', 'table path'+'table',, hADSHandle )  //=> lSuccess
 


3. Open it simple as this:
Code: Select all  Expand view

 use table alias youralias shared
 



Thanks.

Good Luck!


Hmm. Now my test app is running on the internet. When I access the ADS via my Internet provider, the
application is running OK (because PING reply time < 1ms).

But when I connect from client via different ISP, the app is too slow, because PING reply time is
between 16 and 18 ms ...

BTW, what are your average PING response times ?

Thanks, Roman

Re: Free tables and Advantage Internet Server (AIS)

PostPosted: Sat Nov 21, 2009 2:41 am
by fraxzi
Hi Roman,

Ping response time is unpredictable on ADSL.. (depending on the bandwidth)

on 2Mbit:

less than or equal to 200ms is considered fast.


Regards,
Fraxzi