Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread What could be causing READONLY to set to TRUE?
Wed, Feb 15 2006 7:29 AMPermanent Link

"Vad"
Hi,
What sort of devilry is this? I use a local encrypted table and when I open
it in my app using Open
method, the READONLY property sets to true!
I have all the rights to all files (.dat, .idx and .blb), the READONLY
property is in False before i open the table, the Open method change it to
True, (when i run the program step by step). The files are in my local
machine running DBISAM v4.22b3, Win2K SP4, Delphi 7.......
What could be the problem?
Here is my code:
procedure TFDM.DataModuleCreate(Sender: TObject);
begin
 DBISAMDatabase.Directory := ExtractFilePath(Application.ExeName)+'DATA\';
 DBISAMEngine.LockFileName := DBISAMDatabase.Directory + 'dbisam.lck';
 DBISAMDatabase.Session.SessionType:=stLocal;
 DBISAMEngine.Active := TRUE;
 DBISAMDatabase.Connected := TRUE;
 DBISAMDatabase.Session.AddPassword('admin');  // for users.dat
 DBISAMTable.Open;
end;

Thanks,
Vad

Wed, Feb 15 2006 11:36 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Vad,

<< What sort of devilry is this? I use a local encrypted table and when I
open it in my app using Open method, the READONLY property sets to true! >>

The things that can cause this are:

1) Read-only attribute on any of the table's physical files (.dat, .idx, or
..blb).
2) Improper user rights
3) Any of the above on the dbisam.lck lock file also (this forces the whole
database directory to read-only).

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Feb 16 2006 3:04 AMPermanent Link

"Vad"
Tim,
A problem was with dbisam.lck!
I logged executing of my application using Filemon (www.sysinternals.com).
After performance of these lines of a code:

DBISAMDatabase.Directory := ExtractFilePath(Application.ExeName)+'DATA\';
DBISAMEngine.LockFileName := DBISAMDatabase.Directory + 'dbisam.lck';


I have seen it:


10:27:31 immobili.exe:664 READ  D:\Delphi_projects\Immobili\immobili.exe
SUCCESS Offset: 1623040 Length: 32768
10:27:31 immobili.exe:664 OPEN
D:\Delphi_projects\Immobili\DATA\D:\Delphi_projects\Immobili\ NAME INVALID
Options: Open Directory  Access: All
10:27:31 immobili.exe:664 CREATE
D:\Delphi_projects\Immobili\DATA\D:\Delphi_projects\Immobili\DATAdbisam.lck
NAME INVALID Options: OverwriteIf Sequential  Access: All
10:27:31 immobili.exe:664 OPEN
D:\Delphi_projects\Immobili\DATA\D:\Delphi_projects\Immobili\DATAdbisam.lck
NAME INVALID Options: Open  Access: All

where does "D:\Delphi_projects\Immobili\DATA\D:\Delphi_projects\Immobili\ "
come from?

I don't know what was the reason of the error.

Vad




Thu, Feb 16 2006 3:52 AMPermanent Link

Dan Rootham
Vad,

<<After performance of these lines of a code:
DBISAMDatabase.Directory := ExtractFilePath(Application.ExeName)+'DATA\';
DBISAMEngine.LockFileName := DBISAMDatabase.Directory + 'dbisam.lck';
I have seen it:
D:\Delphi_projects\Immobili\DATA\D:\Delphi_projects\Immobili\DATAdbisam.lck
NAME INVALID Options: OverwriteIf Sequential  Access: All >>

My guess is that your statement should read:
 DBISAMEngine.LockFileName :=
   IncludeTrailingPathDelimiter(DBISAMDatabase.Directory) + 'dbisam.lck';
because the logfile suggests that a backslash is missing after "DATA".

HTH,
Dan



Thu, Feb 16 2006 5:27 AMPermanent Link

"Vad"
Dan,

> My guess is that your statement should read:
>   DBISAMEngine.LockFileName :=
>     IncludeTrailingPathDelimiter(DBISAMDatabase.Directory) + 'dbisam.lck';
> because the logfile suggests that a backslash is missing after "DATA".

Thanks, but it has not helped.

Instead of

"D:\Delphi_projects\Immobili\DATA\D:\Delphi_projects\Immobili\DATAdbisam.lck
"

i have

"D:\Delphi_projects\Immobili\DATA\D:\Delphi_projects\Immobili\DATA\dbisam.lc
k".

This pathname is incorrect!

Why the pathname is duplicated? I can't understand that thing!



Vad

Thu, Feb 16 2006 6:31 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Vad


Is this  

DBISAMEngine.LockFileName := DBISAMDatabase.Directory + 'dbisam.lck';

your problem?

From the manual


The default lock file name "dbisam.lck" can be modified to any file name desired by modifying the TDBISAMEngine LockFileName property.

This suggests you can change the name, but not the location which is what you're trying to do.

Roy Lambert
Thu, Feb 16 2006 7:36 AMPermanent Link

"Vad"
> Is this  
> DBISAMEngine.LockFileName := DBISAMDatabase.Directory + 'dbisam.lck';
> your problem?
>
> From the manual

> The default lock file name "dbisam.lck" can be modified to any file name
desired by modifying the TDBISAMEngine LockFileName property.
>
> This suggests you can change the name, but not the location which is what
you're trying to do.

Many thanks Roy! You are really right! Oh my God, I'm really stupid! Smile

Vad

Thu, Feb 16 2006 8:51 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Vad


Don't wory - we've all been there.

Roy Lambert
Image