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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDX or IDX problem???? 2

Status
Not open for further replies.

Gert

Programmer
Apr 9, 2000
240
DO
Hi all

I got a problem with my dbf structure, when the power goes off, normaly due to electricity problems, when I try to run the program i got the error, "Index noes not macth the table, delete the index and recreate", but if i delete file and try to index using "Set order to tag 'indexkey'" then i got the error "Table have not index" and I have to open the table and recreate the index manualy, could be a way where i can recreate the CDX index programatically without open the database and recreate.
I can do with IDX,deleting de file and recreating again, but now I my hole proyect is build using CDX index.

Could somebody giveme a hand??
 
Hello

First, you cannot index a table using 'SET ORDER TO TAG tagname', because this command assumes the index exists already.

Second, there is no way to find how a table was indexed if the index file is deleted or becames corrupt.

The only way to restore indexes programatically is to store infos about them somewhere else (maybe in a separate table) and when you'll try to reindex them you have to read the index info from that table and issue the ALTER TABLE tablename ADD PRIMARY KEY (check the help file for complete sintax) if you want to add a primary key (there is no INDEX command to add the primary key) or simply INDEX ON expression TAG tagname

Hope this helps Grigore Dolghin
Class Software
Bucharest, Romania
 
Third,

IF you are having that kind of power problem. Get a UPS.

 
Thank fluteplr
Is not a UPS problem, sometime the computer freeze or just i got some error from Windows and the programs have to be shutdown.

Can i use IDX indexs, does it have some problems, witch could be the main deferences??
 
Gert,
Any machine used simply as a .DBF file server shouldn't be freezing up. Make sure it has all the latest OS patches applied and any third-party (running) products upgraded - e.g. Virus Checkers. If you aren't running a true server (WinNT, Win2000, Unix, etc.) as in a peeer-to-peer network, then you really shouldn't be running any other major applications on the "server".

Rick
 
If you have a backup copy of the indexes, copy them (CDX , IDX only) to the location of the damages indexes. Then reindex.

After you finished repairing the indexes document them and store them in a table.
example

After you store them in a table, You can write programs to reindex files
example
David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Hi dave.
I would like to know if the SYSINDEX table is the table that I would like to repair the CDX indexes?, because if I change this name for my table name then i got an error on the program, but if I change one of my table name and renamed for "SYSINDEX" the the program run OK.

Thanks a lot


No, you misunderstood my answer
1. You have to fix your CDX or IDX problem. There is nothing I can do to help you with that.
2. AFTER You fix your index problem, The do what I suggested.
This will allow you to run programs to reindex your databases programically.

You can not fix your problem by rename a database to SYSINDEX and running the system.

The table SYSINDEX is a table you create and maintain so you can rename it anything you want.
[tt]
Structure for table: D:\BIDSYS\DBF\SYSINDEX.DBF
Number of data records: 100
Date of last update: 07/15/2001
Memo file block size: 64
Code Page: 1252
Field Field Name Type Width
1 DRIVE Character 2
2 DIRECTORY Character 25
3 NAME Character 10
4 WORKAREA Character 25
5 PACK Logical 1
6 CLEANUP Logical 1
7 AVAIL Logical 1
8 COMPLETED Date 8
9 CDXPRG Memo 4
10 MAINTPRG Memo 4
[/tt] David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Thanks DAVE,
Or my DBF's are working properly, but I would like to create the programs because sometime I got some problems with the CDX's indexes.

Thanks a lot
 
OK, if you want to use my SYSINDEX routine.
Create the SYSINDEX.DBF as per the stru above.
Populate it with the DBF info as follows to reindex. (one record per dbf)

DRIVE = Network drive letter the DBF's on on (ie "F:")
DIRECTORY = Network Directory Stur where the files are located ("\sys\dbf\")
NAME=DataBase Name ("customer") (no dbf extension)
WORKAREA=drive & directory to use as a backup copy just in case ("C:\tmp\")
PACK= is the dbf to be packed befoe the index
CLEANUP=is the dbf to be deleted after the reindex
AVAIL=internal flag field do not populate, has another computer reindexed it
COMPLETED=internal flag field, do not populate, when last reindex.
CDXPRG=run the cdxstru program and it will populate this field for you.
MAINTPRG=not used, for future dreams.

In the middle of a crunch, you can have any number of computers running SYSINDEX.PRG, I have run it with 5. Anything above that and the server started to lose performance, but that was on a 100mps line, single processor, 233mz CPU. David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Thanks
David W. Grewe
Know work 100%, thanks a lot.

but??, if I want that is work with more than one Database??
could be possible?

Thanks a lot you have been done a lot for me.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top