Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Detaching index?

Detaching index?

Detaching index?

I have a database where multiple users enter data into it.  Sometimes the index detaches itself from the database and I couldn't figure out why.  Please help!  I use FP for DOS 2.5

RE: Detaching index?

Are you talking of CDX or IDX index files? Does the problem occur within FoxPro command environment or within your application?

RE: Detaching index?

I'm talking about the CDX file.  What happened is that the CDX file still exist, but it detaches itself from the dbf.  When that happens, I associate the dbf with the index and then reindex it.  But it happens quite frequently these days.  We have multiple users enter directly into the browse window.  There's no fancy application.

Thank you.

RE: Detaching index?

Do you have any process that copies the data file, then copies or renames it back?  For example:

use mytable  && has a cdx
copy to temp     && oops! didn't use "with cdx"
use temp
copy to mytable  && cdx might still be physically there
                 && but it is no longer "connected"

Robert Bradley

FoxDev - Visual FoxPro Development

RE: Detaching index?

Yes, I do have a program that makes a copy of a database.  The users run this program everyday but it doesn't disconnect the cdx on a daily basis.  It only happens sometimes (more frequently lately).

I'm attaching the program below...

Thanks alot for your help!
clear all
set safety off
set deleted on

This program will print registrations for Accounting since <<begin_date>>.
If you have a printer jam or the accounting reports don't print properly, DO NOT re-run the program.

Registration data that is printed will be saved in REG_DBF.SAVE.  If the
accounting report doesn't print properly, you can bring the data back
from the saved file.

The accounting reports will be printed on the LaserJet printer of your choice.

You can press <Esc> and cancel this program at any time.


* Get start dates for printing accounting report
beg_date = date()

ready = .f.
do while not ready
  @ 10, 1 say 'Start Date for printing accounting report:' get beg_date
  @ 13,1 say 'Ready to run (Y/N)?' get ready picture 'Y'
  if readkey() = 12 or readkey() = 268

select (select(1))

select (select(1))
SET RELATION TO DEPT+course_no+section+quarter INTO COURSE

REPORT FORM  ACCOUNT.FRX to print for entry_date >= beg_date ;
and not ACCT_PRINT

REPORT FORM  ACCOUNT.FRX to print for entry_date >= beg_date ;
and not ACCT_PRINT

* Backup copy of registrations printed today.
copy to reg_dbf.sav for entry_date >= beg_date and not ACCT_PRINT

* Update print flags/date in CURREG.DBF.
replace all ACCT_DATE with date(), ACCT_PRINT with .T.  for entry_date >= beg_date

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close