Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PACK command does not work in my program with 5.3

Status
Not open for further replies.

Danwoo

Technical User
Oct 9, 2004
13
US
Hi, about 8 years ago, I have wrote a Clipper program using Clipper 5.01 for my own company. At time time I used Rmake, and Rtlink. It contained 4 DBFs and around 10 indexes. The largest DBF file contained around 200 thousand records. The program has a procedure for packing all files and it works no any problem.

Two years ago, I baught 5.3 (a or b ?), added more functions and modified the program, and recompiled the program and linked with both Blinker and Exospace. The packing procedure for both versions did not work, it either hank or the window closed. The index files then corrupted, forcing me to keep the Rtlink version for just packing the files only.

I am using P4 2.4g, 1024meg of ram and window XP.

I tried the new program with different machines eg window 95, 85..., the problem existed with every machine.

Can anyone help me?

Thanks in advance.

Larry
 
Have you tried writing a program that only does the packing part?

Make sure the program has exclusive access to the DBF's when packing.

Rob.
 
Hi, Larry

I'm assuming you are using DBFNTX.

Try doing your pack with only the dbf open, not the indexes. Then re-create the indexes afterwards. The DBFNTX driver is notoriously flaky.

Another approach would be to set delete on and copy all records to another .dbf, rename the original .dbf & .dbt to a temp name (as a backup) and then rename the copy dbf/dbt to the real name and then recreate the indexes. This would have the advantage of also packing the .dbt files if any.

Jock
 
Thanks Rob for the quick reply.
As your advise, I may have to rewrite a stand alone program to do just packing, hopefully it will work.

Yes, I did have the exclusive lock before packing. In that procedure, it open the first dbf with exclusive lock, if it is sucesful, then continue open the second and so on, after all 4 dbfs open with no net error, then start to pack. If any of then fail, then abort the packing.

I suspected the PACK failed because of 4 areas are opened while packing.

I will try to rewrite the procedure to pack only one at a time and see what happen, I will post the result later.

thanks.

Larry
 
Hi, Jock,

Your are right, I am using DBFNTX.
I am rewriting the PACK procedure with different approach, lets see what the result.
If it still fail, then your method is a good one: just pack the dbfs without the NTXs and then recreat the NTXs afterward. I will post the result of what I found.

thanks

Larry
 
Larry,

Why not switch to the much more reliable DBFCDX driver?

Rob.
 
Hi Rob,
Is that included in the 5.3 pkg or do I have to purchase the additional driver?

thanks.

Larry
 
Is there an easy way to convert my programs from using the DBFNTX driver to the DBFCDX driver?

Some of my applications have up to 10 dbf files opened with as many as 14 different indexs open so that the user can get that data presented in the order they want on the screen. All while scrolling up and down the database using the index they have selected.

Thanks

 
IF ( RDDSETDEFAULT() != "DBFCDX" )
cOldRdd := RDDSETDEFAULT( "DBFCDX" )
ENDIF

Have a look in the NG (C53G01C) at RDDSETDEFAULT.
If you put this line in the startup program you're on DBFCDX.

Rob.

 
Rob,
Thanks for the advise. I was looking for a way to make Dbase VI style multi tags in a single index file. I thought Clipper does not have it, cause I just did not pay attention to the documentation, I guess.

Wow! I have to rewrite the whole program to use dbfcdx, that will keep me busy for a few weeks. And then there is a new BIG.BIG project coming, so I can use this CDX.

regards,

Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top