Hi Loay,
If you attached a file - it was lost. If you want to send it to me directly i'd be
glad to have a look for you.
Cheers,
Charlie
----- Original Message -----
From: Loay Habash
To: delphi-en%40yahoogroups.com">delphi-en
yahoogroups.com
Sent: Sunday, February 25, 2007 11:47 PM
Subject: Re: [delphi-en] DBase III to Delphi
Hi,
Thank you for replying my email J
I tried the suggested solution but L unfortunately it could not solve it.
Here a sample file you may could do something caz am fed up of it
Open the attached file with db.exe then change the extension from inf to dbf then you can use the database desktop ... this is the manual solution per each file each time you need to use it I need to use it regularly as another application getting reports from that application.
Thank you again.
Charlie Chambers < chambers%40sofnet.com">chambers
sofnet.com> wrote:
Hi Loay,
I had a similar problem with a Smartware db file and did the following to unlock the db file. Don't know if it will help but might be something that you could use to develop your own code to at least check or reset the bits so as to open and export per your needs???
const
fFixDB:Array[1..4] of byte = (0,0,0,0);
fLockedDB:Array[1..4] of byte = (255,255,255,255);
{----------------------------------------------------------}
function TForm1.UnlockDB(FileName:String):Boolean;
var fFileH,I: Integer; B:Boolean;
begin
B:=False;
if FileExists(FileName) then begin
fFileH:=FileOpen(FileName,fmOpenReadWrite);
if fFileH>0 then begin
FileSeek(fFileH,20,0);
I:=FileWrite(fFileH, fFixDB, 4);
if I=4 then //Ok
else
if fException=True then begin
Raise Exception.Create('Cannot UnlockDB');
end;
end;
FileClose(fFileH);
B:= NOT IsDBLocked(FileName);
end;
UnLockDB:=B;
end;
{----------------------------------------------------------}
Cheers,
Charlie
----- Original Message -----
From: Loay Habash
To: delphi-en%40yahoogroups.com">delphi-en
yahoogroups.com ; Greatis Delphi Pages
Sent: Saturday, February 24, 2007 6:38 AM
Subject: [delphi-en] DBase III to Delphi
Hello,
I need to migrate dbf files from an old application to another db format, From old application built on clipper dbase III, the problem you can't open the file directly by the "Databse Descktop" error "unable to open table, corrupt table/index header", but first you need to open it by Dbase "DBU.EXE" , and it should be file by file,�� then you can open it with "Database Desktop",�. After investigation about why is that I new that there is exclusive table lock by the application,�..
So how can I write a procedure that will unlock all the tables before doing the migration,â?¦.
Thank you
Loay Habash,
http://groups.yahoo.com/group/WeLoveYouAll/
http://profiles.yahoo.com/leohabash
leohabash%40yahoo.com">leohabash
yahoo.com
Mobile: +966503322315
---------------------------------
Want to start your own business? Learn how on Yahoo! Small Business.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Loay Habash,
http://groups.yahoo.com/group/WeLoveYouAll/
http://profiles.yahoo.com/leohabash
leohabash%40yahoo.com">leohabash
yahoo.com
Mobile: +966503322315
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
.