Trying to switch to ADS
Publicado: Mié Jul 28, 2010 4:02 pm
[sorry wrong forum]
First of all, I have purchased and should be posting in 'Xailer Pro English', but couldn't change my current account to do so?
Now the real issue:
I have a little program and it is total set for local environment (CDXDataSource) and it runs well. Now I want to use the program in a network environment (and later it should be accessible through internet), so I am testing ADS.
Installed ADS and it is working. I also created a .add file and added tables to it. I think I should be finished here with configuring ADS?
Configured the little program:
Procedure Main()
REQUEST ADS
RddRegister("ADS",1)
RddSetDefault("ADS")
ADSSetServerType(2)
AdsSetFileType(2)
REQUEST ADSKEYCOUNT, ADSKEYNO, ADSGETRELKEYPOS, ADSSETRELKEYPOS
Application:cTitle := "EMS Windows"
Application:oIcon := "ems"
/*
WITH OBJECT TIni():New( ".ems.ini" )
SetLanguage( :GetEntry( "OPTIONS", "Language", 0 ) )
END
*/
TFormMain():New( Application ):Show()
Application:Run()
Return
and using:
METHOD ConnectToEMSADSServer( oSender ) CLASS TFormMain
IF AdsConnect60( "10.2.1.182:6262EMSDataemsdata.add", 2,"XXXX","XXXX")
AdsRightsCheck(.F.)
AdsLocking(.F.)
USE users alias TEST via "dbfcdx"
ELSE
MsgStop("NO")
QUIT
ENDIF
RETURN Nil
The AdsConnect60 is true... but now i am lost? If i try after AdsConnect60 to connect to a database with the USE command it says dos error 2?
Not quite sure what I am doing wrong?
I have also the following ads.ini:
ads.ini
[EMSServer]
LAN_IP=10.2.1.182
LAN_PORT=6262
[SETTINGS]
ADS_SERVER_TYPE = 2
[SETTINGS]
ADS_FORCE_CLIPPER_MEMOS = 1
RETRY_ADS_CONNECTS = 1
But if I try:
IF AdsConnect60( "10.2.1.182:6262EMSDataemsdata.add", 2,"XXXX","XXXX")
it works, but if I try:
IF AdsConnect60( "EMSServerEMSDataemsdata.add", 2,"XXXX","XXXX")
It fails to work?
Probably I should also switch from TCdxDataSource to TAdsDataSource, but also not sure what to do there? Must I fill out "cConnect", "cPassword" and "cUser" again and set lUseDictionary to true? I tried is but can't get it to work?
Who can help me?
Maarten Roos
First of all, I have purchased and should be posting in 'Xailer Pro English', but couldn't change my current account to do so?
Now the real issue:
I have a little program and it is total set for local environment (CDXDataSource) and it runs well. Now I want to use the program in a network environment (and later it should be accessible through internet), so I am testing ADS.
Installed ADS and it is working. I also created a .add file and added tables to it. I think I should be finished here with configuring ADS?
Configured the little program:
Procedure Main()
REQUEST ADS
RddRegister("ADS",1)
RddSetDefault("ADS")
ADSSetServerType(2)
AdsSetFileType(2)
REQUEST ADSKEYCOUNT, ADSKEYNO, ADSGETRELKEYPOS, ADSSETRELKEYPOS
Application:cTitle := "EMS Windows"
Application:oIcon := "ems"
/*
WITH OBJECT TIni():New( ".ems.ini" )
SetLanguage( :GetEntry( "OPTIONS", "Language", 0 ) )
END
*/
TFormMain():New( Application ):Show()
Application:Run()
Return
and using:
METHOD ConnectToEMSADSServer( oSender ) CLASS TFormMain
IF AdsConnect60( "10.2.1.182:6262EMSDataemsdata.add", 2,"XXXX","XXXX")
AdsRightsCheck(.F.)
AdsLocking(.F.)
USE users alias TEST via "dbfcdx"
ELSE
MsgStop("NO")
QUIT
ENDIF
RETURN Nil
The AdsConnect60 is true... but now i am lost? If i try after AdsConnect60 to connect to a database with the USE command it says dos error 2?
Not quite sure what I am doing wrong?
I have also the following ads.ini:
ads.ini
[EMSServer]
LAN_IP=10.2.1.182
LAN_PORT=6262
[SETTINGS]
ADS_SERVER_TYPE = 2
[SETTINGS]
ADS_FORCE_CLIPPER_MEMOS = 1
RETRY_ADS_CONNECTS = 1
But if I try:
IF AdsConnect60( "10.2.1.182:6262EMSDataemsdata.add", 2,"XXXX","XXXX")
it works, but if I try:
IF AdsConnect60( "EMSServerEMSDataemsdata.add", 2,"XXXX","XXXX")
It fails to work?
Probably I should also switch from TCdxDataSource to TAdsDataSource, but also not sure what to do there? Must I fill out "cConnect", "cPassword" and "cUser" again and set lUseDictionary to true? I tried is but can't get it to work?
Who can help me?
Maarten Roos