function OpenFileBlock(var FP: IsamFileBlockPtr; OutputPath: string):
boolean;
begin
{$IFDEF Network}
BTOpenFileBlock(FP, OutputPath + XREFDB_NAME, True, True, False, True);
{$ELSE}
BTOpenFileBlock(FP, OutputPath + XREFDB_NAME, False, False, False, False);
{$ENDIF}
if not IsamOK then begin
MessageDlg('FileBlock opening failed (' + IntToStr(IsamError) + ')...',
mtError, [mbOK], 0);
Halt;
end;
Result := IsamOK;
end;
I had to convert the application to a Delphi 5 one. In order to do so, I
updated B-Tree Filer to verion 5.55. Here is my new procedure:
function OpenFileBlock(var FP: IsamFileBlockPtr; OutputPath: ShortString):
boolean;
begin
{$IFDEF Network}
BTOpenFileBlock(FP, OutputPath + XREFDB_NAME, True, True, False, True);
{$ELSE}
BTOpenFileBlock(FP, OutputPath + XREFDB_NAME, False, False, False, False);
{$ENDIF}
if not IsamOK then begin
MessageDlg('FileBlock opening failed (' + IntToStr(IsamError) + ')...',
mtError, [mbOK], 0);
Halt;
end;
Result := IsamOK;
end;
Both procedures are rather identical. Yet with the Delphi 5 application,
two network users (the OS seems to be irrelevant) cannot be running it at
the same time. The second user will get an error '10140'.
Does anybody may know what the problem might be? I don't seem to find an
answer.
> function OpenFileBlock(var FP: IsamFileBlockPtr; OutputPath: ShortString):
> boolean;
> begin
> {$IFDEF Network}
> BTOpenFileBlock(FP, OutputPath + XREFDB_NAME, True, True, False, True);
> {$ELSE}
> BTOpenFileBlock(FP, OutputPath + XREFDB_NAME, False, False, False,
False);
> {$ENDIF}
> if not IsamOK then begin
> MessageDlg('FileBlock opening failed (' + IntToStr(IsamError) +
')...',
> mtError, [mbOK], 0);
> Halt;
> end;
> Result := IsamOK;
> end;
>
>
> Both procedures are rather identical. Yet with the Delphi 5 application,
> two network users (the OS seems to be irrelevant) cannot be running it at
> the same time. The second user will get an error '10140'.
>
> Does anybody may know what the problem might be? I don't seem to find an
> answer.
Is this really a read-only fileblock? If not, the first two boolean
parameters passed to BTOpenFileBlock (ReadOnly and AllReadOnly) should be
False, not True.
What are you passing to BTInitIsam as the ExpectedNet parameter? This
should be MsNet for a 32-bit network application.
--Rob [TPX]
Here is my call to BTInitIsam:
Result := BTInitIsam(MsNet, 8); {allocating 8-page buffer}
I did try to set the first two parameters passed to BTOpenFileBlock to
'False' instead to 'True' to no avail. I still get 'error 10140'.
"Rob Roberts [TPX]" <do...@email.me> wrote in message
news:X0IDwd6e...@tpsmail01.turbopower.net...
> {.$DEFINE NoNet}
> {.$DEFINE Novell}
> {$DEFINE MsNet
>
> Now, the program works on the network.
Glad you got it working. (I should have thought to mention the MsNet define
in BTDEFINE.INC in my first response... )
--Rob [TPX]
Yes, my application uses only one fileblock. It is open in the 'FormCreate'
event and closed in the 'FormDestroy' one. The file, it 'points' to, has
only two fields. Each field is made up of 11 digits number (UPC number). The
file is used for cross references purpose.
IsamDOSError returns code 32 (Sharing violation).
IsamDOSFUnc returns code 27648. I am not sure what to do with this code.
"Rob Roberts [TPX]" <do...@email.me> wrote in message
news:JMpe22Df...@tpsmail01.turbopower.net...
> Jean,
>
> > Here is my call to BTInitIsam:
> >
> > Result := BTInitIsam(MsNet, 8); {allocating 8-page buffer}
>
> Does your application only open one fileblock at a time? If not, 8 is too
> low for the Pages parameter to BTInitIsam. The READ.1ST file recommends
> using 8 per open fileblock.
>
> > I did try to set the first two parameters passed to BTOpenFileBlock
> > to 'False' instead to 'True' to no avail. I still get 'error 10140'.
>
> Check the values of IsamDOSError and IsamDOSFunc immediately after the
> IsamError 10140 occurs. This should help track down exactly what is going
> wrong. (See page 86 of the manual for explanations of IsamDOSError and
> IsamDOSFunc.)
>
> --Rob [TPX]
>
>
> Here is my call to BTInitIsam:
>
> Result := BTInitIsam(MsNet, 8); {allocating 8-page buffer}
Does your application only open one fileblock at a time? If not, 8 is too
low for the Pages parameter to BTInitIsam. The READ.1ST file recommends
using 8 per open fileblock.
> I did try to set the first two parameters passed to BTOpenFileBlock
> to 'False' instead to 'True' to no avail. I still get 'error 10140'.
Check the values of IsamDOSError and IsamDOSFunc immediately after the
In terms of 'BTDEFINE.INC,' here are the first few lines of the file:
{===B-Tree Filer defines=============================================}
{$DEFINE NoNet}
{.$DEFINE Novell}
{.$DEFINE MsNet
I replaced them with:
{===B-Tree Filer defines=============================================}
{.$DEFINE NoNet}
{.$DEFINE Novell}
{$DEFINE MsNet
Now, the program works on the network.
Thanks for all your help.
"Rob Roberts [TPX]" <do...@email.me> wrote in message
news:rWN3l0Ef...@tpsmail01.turbopower.net...
> Jean,
>
> > IsamDOSError returns code 32 (Sharing violation).
> > IsamDOSFUnc returns code 27648. I am not sure what to do with this code.
>
> That sharing violation indicates that somehow the fileblock isn't being
> opened in network mode. Do you have MsNet defined in BTDEFINE.INC? Also,
> see page 81 of the manual for requirements for successfully opening a
> network fileblock.
>
> Have you tried the DelDemo example application? I recommend trying it out
> to see if you can run it from more than one workstation at a time. After
> you can do that, see what is different between its calls to BTInitIsam and
> BTOpenFileBlock and the ones in your app.
>
> --Rob [TPX]
>
>
> IsamDOSError returns code 32 (Sharing violation).
> IsamDOSFUnc returns code 27648. I am not sure what to do with this code.
That sharing violation indicates that somehow the fileblock isn't being