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

Display selected row/s and its file name from multiple dbf

Status
Not open for further replies.

TheLazyPig

Programmer
Sep 26, 2019
94
PH
Hi!

Example that I have multiple dbf's and selected row/s from one of them. I want to display the selected row/s and the file name of dbf in a table.


Thanks in advance!
 
How did you select the records from the multiple dbf's? Select statement?

If so just add dbf(), recno() to the select statement to get the dbf name and record number in the result.

Eg: Select *,dbf() as dbfname ,recno() as rowno from tablename into cursor temp.





 
I used select statement to get the records. I tried your query but dbf() return is .tmp file and different path from where I was testing the program.

I don't want it to have a specific path so I used CURDIR() and the dbf's were located from a sub-folder.

dbfname_hneleh.jpg
 
Since it is showing .tmp as the dbfname, your final select query must be from a cursor and not a table.

Put the select statement with dbf(), recno() in the first queries that created the cursor(s) (.tmp files).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top