Hello,
Please, who are the exports of ADS and Harbour?.
Thank you.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Hello,
Please, who are the exports of ADS and Harbour?.
Thank you.
聽 聽// ALS connection
聽 聽IF AdsConnect60( cPathLoc, ADS_LOCAL_SERVER, "ADSSYS",, 0, @nHandLoc) == .F.
聽 聽 聽 nError:=AdsGetLastError(@cError)
聽 聽 聽 ? cError
聽 聽 聽 return NIL
聽 聽ENDIF
聽 聽
聽 聽// Open a dbf
聽 聽// DbUseArea( [<lNewArea>], [<cRddName>], <cDatabase>, [<cAlias>], [<lShared>], [<lReadonly>], [<cCodePage>], [<nConnection>] )
聽 聽 DbUseArea( .T., "ADSCDX", cPathLoc + "PRMTR.DBF", "prm_loc", .T.,,, nHandLoc )
聽 聽
聽 聽// ADS connection
聽 聽IF AdsConnect60( cPathRem, ADS_REMOTE_SERVER, "ADSSYS",, 0, @nHandRem) == .F.
聽 聽 聽 nError:=AdsGetLastError(@cError)
聽 聽 聽 ? cError
聽 聽 聽 return NIL
聽 聽ENDIF
聽 聽
聽 聽// Open a dbf
聽 聽 DbUseArea( 聽 聽 聽 聽 聽 聽.T., 聽 聽 "ADSCDX", cPathRem + "PRMTR.DBF", "prm_rem", 聽 聽 聽 聽 .T., 聽 聽 聽 聽 聽 聽 聽, 聽 聽 聽 聽 聽 聽 聽, nHandRem )
聽 聽// Check if ADS or ALS is running
聽 聽lADS := AdsConnect( cPathRem ) // -> .T.
聽 聽lADS := AdsConnect( cPathLoc ) // -> .F.Frank,
Thank you.
But using AIS via Internet it gives:
DbUseArea( .T., "ADSCDX", "C:\LUCAS\CONTA.DBF", "LUCAS" )
Error ADSCDX/5132 The specified database object name is not valid.: C:\LUCAS\CONTA.DBF
dbcreate( "mem:FICHA1", aEstructura , "DBFCDX" )
...
HB_DBCreateTemp( "FICHA1", aEstructura , "DBFCDX" )
The location of the Internet-enabled Advantage Database Server must be specified. In addition, you must also configure your application to use the Advantage Internet Server server type. See Connecting Clients through the Internet to Advantage for details. Below are the three ways to specify the location of the Internet-enabled Advantage Database Server:
1. Use the server's IP address and Internet port number in the connection path string. The path can be specified as \\<ip address>:<ip port>\share\Dir\DataDictionary.add, where the <ip address> is the IP address where the Advantage Database Server is located, and the <ip port> is the Internet Port that the Advantage Database Server is listening.
Example of using the server鈥檚 IP address and Internet port number with the Advantage Client Engine API:
ulRetVal = AdsConnect60("\\\\193.69.232.1:6262\\share1\\test.add",
ADS_AIS_SERVER,
"User1",
"foobar",
ADS_DEFAULT,
&hConnect );
Similar functionality for specifying the IP address and port in the connection string/path is available in other Advantage clients. The details related to making a connection through the Internet to the Advantage Database Server from other clients can be found in the respective Advantage client Help documentation.
2. Specify the server name in the connection string. The path can be specified as \\<server name>\share\Dir\DataDictionary.add, where the <server name> is the name of a server specified in the ADS.INI file. The ADS.INI file specifies the actual IP address where the Advantage Database Server is located, and IP port that the Advantage Database Server is listening, that correspond to the specified server name. See Setting Up Your Clients Using ADS.INI for more specifics on information in the ADS.INI file.
Example of using a server name with the Advantage Client Engine API:
ulRetVal = AdsConnect60( "\\\\server1\\share1\\test.add",
ADS_AIS_SERVER,
"User1",
"foobar",
ADS_DEFAULT,
&hConnect );
3. Specify a drive letter in the connection string. The drive letter can be specified as <x:>\Dir\DataDictionary.add, where the <x:> is the name of a drive letter specified in the ADS.INI file. The ADS.INI file directly or indirectly specifies the actual IP address where the Advantage Database Server is located, as well as the IP port that the Advantage Database Server is listening, that correspond to the specified drive letter. See Setting Up Your Clients Using ADS.INI for more specifics on information in the ADS.INI file.
Example of using a drive letter with the Advantage Client Engine API:
ulRetVal = AdsConnect60( "x:\\test.add",
ADS_AIS_SERVER,
"User1",
"foobar",
ADS_DEFAULT,
&hConnect );
The Advantage Internet Server configuration can be specified in the ADS.INI file by adding a couple of sections.
The [Drives] section lists the complete UNC path to which a drive letter is mapped. If your client application uses drive letters, you will need to define the drive letter mappings.
Example:
[ Drives ]
R:=\\SERVER1\SHARE
For each Advantage Database Server you want to connect to, you will need to have a separate server-name entry.
Example:
[ <server name> ]
INTERNET_PORT=<the Internet port for the server>
INTERNET_IP=<the IP address for the Advantage Database Server>
Example:
[Drives]
Q:=\\serverA\testsys\
r:=\\serverB\data\
[serverA]
INTERNET_PORT=2001
INTERNET_IP=198.169.1.69
[serverB]
INTERNET_PORT=2002
INTERNET_IP=198.70.169.72
#include "ads.ch"
#define CRLF Chr(13)+Chr(10)
Request ADS,ADSKeyCount,ADSKeyNo,OrdKeyCount,OrdKeyNo,
AdsGetRelKeyPos, AdsSetRelKeyPos
//-------------------------------------------------------------------------颅---//
function Main()
local aArray := {}, cDbf, i
RddRegister( "ADS", 1 )
RddSetDefault( "ADS" )
//setting up server type
// 1 = Local Server (no client / server)
// 2 = Remote Server
// 3 = Local + Remot
// 4 = Internet Server
// 5 = Local + Internet
// 6 = Remote+Internet
// 7 = Local + Remote + Internet , best choice
adsSetServerType( 4 ) // 贸
adsSetServerType( ADS_REMOTE_SERVER )
//setting up the file types
// 1 = DBFNTX
// 2 = DBFCDX
// 3 = ADSADI
adsSetFileType( ADS_CDX )
AdsRightsCheck(.F.)
IF AdsConnect60( "\\194.224.200.2:2400\lucas\lucas.ADD",
4 ,"massimo","")
// MsgInfo("Esta ahora conectado al Sevidor AIS "+CRLF+CRLF+;
// "You are now connected to AIS Server","Bienvenido /
Welcome / Versi贸n "+ADSVersion())
ELSE
alert("Se ha rechazado la conexi贸n al servidor AIS, por favor
intente mas tarde"+CRLF+CRLF+;
"Conection to AIS Server rejected, please, try again later")
alert( "Error:"+cValtochar( AdsGetLastError() )+CRLF +;
"Servidor:", "Usuario" )
QUIT
ENDIF
i := dbCreate( ("\\194.224.200.2:2400\LUCAS\MASSIMO"),
{ { "FNUMERO" , "N", 20, 0 }, ;
{ "FCODIGO" , "C", 20, 0 }, ;
{ "FPARCIAL2" , "N", 24, 10 } } )
Alert(i) // I GET .T.
use \\194.224.200.2:2400\LUCAS\MASSIMO.DBF new
// i get ADSCDX/5132 The specified database object name is not
valid.: \\194.224.200.2:2400\LUCAS\MASSIMO
browse()
alert(AdsDeleteFile("\\194.224.200.2:2400\LUCAS\MASSIMO.dbf") ) //
I GET .T.
alert(AdsDeleteFile("c:\lucas\oterfile.dbf") ) // I GET .T.
dbcloseall()
quit
return nilLucas,
yes, you can't use AIS with free tables.
How you want to configure the 'The security level' without a database (Advantage Data Dictionary), so CATCH 21 ![]()
So, if you still want to use free tables via Internet, set up a VPN infrastructure and use ADS!
Frank,
Thank you. Your idea works
.
I am having trouble with indexes and Data Dictorionary. I create the indexes as INDEX ON FIELD TO INDEXNAME but AIS ignores that.
I think working with a Data Dictionary you need to reindex using AdsReindex(), not INDEX ON command... I麓m not sure,
Carlos, I sent you an email.
Thank you very much.
EXECUTE PROCEDURE sp_CreateIndex90(
'caja',
'caja.adi',
'NUM_CIUD',
'num_ciud',
'',
2,
512,
'' );
Thank you, but I need to create the indexes on .prg side, not ARC.
I also need several indexes.
This code works perfect in ADS remote, local or DBCDX but not in AIS:
// Todas las series
INDEX ON FSERIE + StrZero (FNUMERO,20 ) TO (cMyPath+"FACTUR1") FOR !Deleted()
// Serie A, B
INDEX ON FSERIE + StrZero (FNUMERO,20 ) TO (cMyPath+"FACTURA") FOR (FSERIE="A") .AND. !Deleted()
INDEX ON FSERIE + StrZero (FNUMERO,20 ) TO (cMyPath+"FACTURB") FOR (FSERIE="B") .AND. !Deleted()
// Cobrada
INDEX ON FSERIE + StrZero (FNUMERO,20 ) TO (cMyPath+"FACTURC") FOR FCOBRADA="S" .AND. !Deleted()
INDEX ON FSERIE + StrZero (FNUMERO,20 ) TO (cMyPath+"FACTURN") FOR FCOBRADA!="S" .AND. !Deleted()
DbCloseAll()
Any clude, Thank you very much,
cSQL := "CREATE INDEX index1 ON table1 ( field1 ); " 聽 聽 聽 聽 聽 + CRLF +;
聽聽 聽 聽 "CREATE INDEX index2 ON table1 ( field2, field3 ); "
...
IF AdsCreateSQLStatement( cAlias, ADS_ADT, hADSConnection )
聽 聽IF (lOK := ADSExecuteSQLDirect( cSQL ) )
聽 聽 聽 聽...
聽 聽ENDIF
ENDIF
... // Todas las series
INDEX ON FIELD->FSERIE + StrZero (FIELD->FNUMERO,20 ) TO FACTUR1 FOR !Deleted()
// Serie A, B y R
INDEX ON FIELD->FSERIE + StrZero (FIELD->FNUMERO,20 ) TO FACTUR2 FOR FIELD->FSERIE="A" .AND. !Deleted()
INDEX ON FIELD->FSERIE + StrZero (FIELD->FNUMERO,20 ) TO FACTUR3 FOR FIELD->FSERIE="B" .AND. !Deleted()
INDEX ON FIELD->FSERIE + StrZero (FIELD->FNUMERO,20 ) TO FACTUR4 FOR FIELD->FSERIE="R" .AND. !Deleted()
// Cobrada
INDEX ON FIELD->FSERIE + StrZero (FIELD->FNUMERO,20 ) TO FACTUR5 FOR FIELD->FCOBRADA="S" .AND. !Deleted()
INDEX ON FIELD->FSERIE + StrZero (FIELD->FNUMERO,20 ) TO FACTUR6 FOR FIELD->FCOBRADA!="S" .AND. !Deleted()
DbCloseAll()