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

Modify dbf

Status
Not open for further replies.

jennysu

Technical User
Jul 23, 2004
11
CA
Hi,

I don't know anything about database :(
My questions are:

If I delete a record in .dbf file with dbf viewer, am I going to make the database corrupt? If I edit .dbf file how about the .cdx and .tdx file?

I'm asking about this because everyday I have to delete some records via the program, it isn't really gone and it creates second set of files (.dbf, .cdx, .tdx) and every few weeks I have to call the vendor to (really) delete those records. Offcourse I have pay him few hundreds $.



Thanks,
 
jennysu

Hmmmm said:
You keep getting bad data and you have to pay the vender to fix the problem?

Deleting data straight from a table is dangerous if you do not know the database design. Tables / records are often linked. If you delete a record in one place, you may create orphans elsewhere which then requires more maintenance work.

You seem to be between a rock and a hard place.

I think you should consider...
- how much are you spending on ad hoc support?
- would an annual contract be more reasonable?
- should you hire a third party consultant with strong technical skills in DdBase to give you an (hopefully) objective view and direction?
- should you upgrade your database to a newer technology such as Micro$oft Access or other properly sized database tool (i.e. Oracle or MS*SQL for larger applications)?

Richard
 
Or you could pay your vendor to set up a proper delete records procedure or insist he fix the bug in the current procedure if you have one but it isn't really deleting the records.

Questions about posting. See faq183-874
 
As far as I know, in dbf files an application only marks deleted records, then (at the same time or in the future) an application must build a new table (i.e. a new dbf) to compact this table. It's an application responsibility to modify indicies properly.
I think, this dbf maintenance routine is (must be) an integral part of any production system in xBase world. It's so simple task (for xBase system vendors) to offer any kind of DB maintenance software...
 
If you're using .dbf files, then you may very well be in an xBase environment, or a some flavor of a FoxPro application. If that is the case, then a DELETE command will not physically delete the record, but only mark it as deleted. The physical removal of those records occur when a PACK command is issued against that DBF file. You might was to insist that your Vendor provide you will some sort of SysAdmin type function, which allows you to then PACK the tables.

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
My two cents worth:

If someone wrote you a special application that you are using then they need to give you the ability to properly delete records and perform general maintenance on the programs data files.

If they did not do this and instead charging you everytime you need to have this done then I would consider them nothing more than a common thief and not a true professional programmer.

I would consider a consultant looking at your system and pointing you in the right direction here.



---------------------------------------
Noble D. Bell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top