Here is the error:
socios.FilePathfull:='c:\tecnoasociacion\datos\';
socios.active:=true;
socios.AddIndex('socnum.ndx','N_SOCIO', [ixPrimary]);
socios.OpenIndexFile('socnum.ndx');
socios.IndexFieldNames:='N_SOCIO';
When there one application running with database opened, when we open a new instance of the same application, this ocurrs (debuging):
socios.FilePathfull:='c:\tecnoasociacion\datos\'; ->OK
socios.active:=true; -> OK
socios.AddIndex('socnum.ndx','N_SOCIO', [ixPrimary]); -> FAIL!!!
Message error: "Exclusive access is required for this operation".
Ok..., then I write the next source code in order to open the index file in exclusive mode, but then turn exclusive mode to false for open other instance application:
socios.FilePathfull:='c:\tecnoasociacion\datos\';
socios.active:=true;
socios.exclusive:=true;
socios.AddIndex('socnum.ndx','N_SOCIO', [ixPrimary]);
socios.exclusive:=false;
socios.OpenIndexFile('socnum.ndx');
socios.IndexFieldNames:='N_SOCIO';
This is the result debugging:
socios.FilePathfull:='c:\tecnoasociacion\datos\'; -> OK
socios.active:=true; -> OK
socios.exclusive:=true; -> OK
socios.AddIndex('socnum.ndx','N_SOCIO', [ixPrimary]); ->FAIL!!!!
And I get the same message error.
If I write source code only for open the DBF file (without indexes), the application running PERFECTLY! in network with database shared.
Is this a bug?, or there any other form for open indexes without that error?.
Thanks!!