Page 1 of 1

ADS server side alias

Posted: Thu Jul 03, 2008 4:56 am
by fraxzi
Hi guys!

Just sharing this amazing discovery with ADS 8.1

Normally, when we do adsconnect60(), we put this on our ads.ini

...
[remoteserver]
INTERNET_IP = <your public ip here>
INTERNET_PORT = 2001
LAN_IP = 192.168.0.1
LAN_PORT = 2002

[Databases]
SERVER = \\remoteserver\DD\database.add;D
...

notice the 'DD' in "\\remoteserver\DD\database.add;D", it's NOT EVEN SHARED nor exist in the server side....


Using ADS 'Server-side aliases', define this to the server side...

file: "AdsServer.ini" put the file to ads 'error log' path which is configured with your ADS server 8.1 or higher ( normaly on C: )

content of "AdsServer.ini" is

[ServerAliases]
DD=D:\AdsDictionary
DB=D:\App1\Tables


the "DB" is the path where you put the tables defined in your database.ADD.... this is to avoid ADS error#8026 "Error obtaining server drive information from server and share names". I dont like the solution posted by ADS wherein my tables are at risk for exposure...


The above is based on actual experienced... if may vary from different condition.

I think it's worth sharing.... Yesterday (July/2/2008) I can't find any info regarding my problem so this maybe useful with others using ADS over internet.


This is total security... there's no way any client can find your tables on the remote side. Applicable and tested.

Regards,

Posted: Fri Jul 04, 2008 5:38 pm
by reinaldocrespo
Padilla;

That was the main reason I started using ADS. NO SHARES. The data is totally hidden from all users. There is no better security than this.

BTW, you can connect to your data also using ip:port/path_to_add in adsconnect().

like this:

xrddpath := "\\192.168.1.1:2000\data\dd.add"
AdsConnect60( xrddpath + cDict, ADS_REMOTE_SERVER, "user", "pass" )

What I usually do is have a .ini file with the path to the dd and the connection mode (REMOTE, LOCAL, INTERNET) written in a section called: [RDD]:

[RDD]
path=\\192.168.1.1.:2000\data\dd.add
rddVer=REMOTE

Just like you said, folder \data on the server does not need to be shared. Totally invisible. SQL what-who?

Here is another tip, from within my app I can execute ISAM commands or simple SQLs, such as:

Code: Select all

SELECT adm.recno AS [Record],
	   adm.adm_num AS [Account],
	   trim( pat.last ) + ' ' + trim( pat.last2 ) + ', ' + pat.name AS [Name],
	   adm.adm_date AS [Adm_date],
	   adm.dis_date AS [Dis_date], 
	   srv.Insurance AS [Insurance],
	   (SELECT SUM( pch.total ) FROM [ptechrgs] pch 
	   		  WHERE pch.adm_num = adm.adm_num ) AS [Charges],
	   srv.real_amt AS [Expectd],
	   srv.ins_paymen AS [Ins_Paymnt],
	   (srv.real_amt - srv.ins_paymen) AS [Pending]
	   FROM admit adm
	   LEFT JOIN service srv ON adm.adm_num = srv.adm_num
	   LEFT JOIN patients pat ON pat.recno = srv.recno
	   WHERE adm.adm_date < '2008-01-01' 
	   AND adm.dis_date > '2007-12-31'
Reinaldo.

Posted: Sat Jul 05, 2008 12:48 am
by fraxzi
Hello Reinaldo

Another great tip you have here! I hope other guys using ADS shares their experiences too! :P


Before I do direct connect \\<ip>:<port>\<share> ... It's great I discover the server-side aliases..

It's easier and manageable using 'AdsServer.Ini' on the server...


I still have many things to test.... I really appreciate the SQL sample you posted... I really need to go to that path...


If any of you ADS guru share wrapper for example AdsSkip() would be greatly appreciated.


Count me IN.


Regards,

Posted: Sat Jul 05, 2008 12:58 am
by reinaldocrespo
I don't think you need the wrapper for adsskip(). It is used by the RDD. Just use (calias)->( dbskip() ). That should work just the same as long as you use ADSNTX or ADSCDX.

Posted: Sat Jul 05, 2008 1:37 am
by fraxzi
I've been testing the table iteration (speed) like:

Code: Select all

for i := 1 to alias->( lastrec() )
     ...
     alias->( dbSkip() )    //here can be be adsskip() since I used ADS all-out
     if alias->(eof())       //here can be ADSIsEOF()... (an example function)
         exit
     end
next

..OR...

I can use dbEval() function which is faster than the for...next iteration.


what is your best best recommendation for this matter?


Regards,