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

editing query results

Status
Not open for further replies.

dennymcdougle

Technical User
Mar 17, 2007
1
US
What is the best way to Select from a table into a dbf, then browse and edit the selected data and then write the changes back to the original table? My current thought is to link the result table to the original data with RECNO().
 
You're better off linking with a primary key than with RECNO().

Tamar
 
The RecNO()'s in the 2 tables will be different, Use a Primarry, Candidate or (if you have to a Unique Index) key

David W. Grewe (Dave)
 
I agree with what Tamar and David say above.

But if you ABSOLUTELY wanted to use the RECNO() as a reference between the original table and the query then you should add a new field to the query results which contained the RECNO() of the original table.

Something like:
Code:
SELECT *,;
   RECNO() AS ReferNo;
FROM OrigDBF;
WHERE <whatever>;
INTO TABLE QueryDBF

SELECT OrigDBF
SET ORDER TO RecNo  && Assuming Index previously created

SELECT QueryDBF
SET RELATION TO ReferNo INTO OrigDBF
<Do Whatever>

The problem is that as records are changed in the Original DBF (appended or deleted), they are not changed in the query results reference.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top