key%tetra@nosc.ARPA (Gerry Key) (08/08/85)
I have a dBASE II question. First, the scenario.
File X.dbf contains 100 records. File Y.dbf contains 0 records
but has the same definition (i.e., STRUCTURE) as X.dbf. Someone
inadvertently issues the command:
. use Y
. copy to X structure
The result is that the 100 records in X.dbf are still there, but
because it now has the definition of Y.dbf, X.dbf appears to con-
tain 0 records. Any reference to a record number in X.dbf pro-
duces an error because the definition thinks there are none.
The question: is there any way to fake the definition of X.dbf
into recognizing those 100 records? I tried doing an APPEND,
thinking that when it updated the definition it would count in
the 100 records that were there plus the dummy record I just ad-
ded. Wrong. It now says I have 1 record in X.dbf instead of 0.
--Gerry
MILNET/ARPANET >-------------------- key@nosc.arpa
akgua \
decvax \
dcdwest \
UUCP allegra -------------!sdcsvax!noscvax!key
ucbvax /
philabs/
ihnp4 /rbloom@apg-1.ARPA (Robert Bloom AMSTE-TOI 3775) (08/09/85)
there is a neat basic program in simtel that lets you do exactly what you want to do. its in micro:<cpm.dbase>, unfortunately, the name escapes me and my list is not handy. it's a library file with fairly good documentation. -bob
jp@lanl.ARPA (08/10/85)
> > > I have a dBASE II question. First, the scenario. > > File X.dbf contains 100 records. File Y.dbf contains 0 records > but has the same definition (i.e., STRUCTURE) as X.dbf. Someone > inadvertently issues the command: > > . use Y > . copy to X structure > > The result is that the 100 records in X.dbf are still there, but > because it now has the definition of Y.dbf, X.dbf appears to con- > tain 0 records. Any reference to a record number in X.dbf pro- > duces an error because the definition thinks there are none. > > The question: is there any way to fake the definition of X.dbf > into recognizing those 100 records? I tried doing an APPEND, > thinking that when it updated the definition it would count in > the 100 records that were there plus the dummy record I just ad- > ded. Wrong. It now says I have 1 record in X.dbf instead of 0. > > --Gerry > I haven't tried this but if the file got screwed up the way you say it did, whynot just reverse the process. Create a new file with the correct structure, enter the appropriate number of records (or more, if you must guess) then copy the correct structure back into your file. If all you did by your mistake was change the structure and record number, this should fix you up. Jim Potter jp@lanl.arpa