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

VIEW run in a script

Status
Not open for further replies.

joshuaguilty

Programmer
Apr 26, 2005
81
CA
I use VIEW to connect two tables to have the relationship. Like tableA and tableB.
replace tableA.field2 for tableA.field1=tableB.field1.
How I could put them into a script?
How I could run these activities when I have different relationship(s) between other tables?
Thanks.
 
Thank you.
I have (old version) of Fox Pro 2.6.
I use VIEW and put tableA under "Work Areas" 1 and tableB under 2, then set the "Relationship".
This is the procedure for me (for years) to compare two tables and do changing of data.
I just want to put under script for job automation.
Thank you again for the reply.
(VIEW is under WINDOW)
 
I think what you are looking for is the SET RELATION command.
 
Sorry for misunderstanding you. Visual Fox introduced "Views" which allow you to read and update data via SQL and at the same time renamed the old "View" window as "Data Session".

Teresa's right to point you towards teh SET RELATION command. This example creates arelationship between the machines and customers tables so that I can read the name and address from the customer table as I'm working with data from a record in the machines table:

[TT]
Select 0
Use customer Order Code
Select 0
Use machines
Set Relation To Code Into customer
[/TT]

As for the script, the Fox equivalent is the program file. The Fox programming language is the same as the language used in the Command Window. Select File, New, Program from the menu, type your commands and save the file as type PRG. Select Do from the Program menu to run it.

Hope this getsyou started.

Geoff Franklin
 
My understanding of your question is that you want to covert a VIEW to is underlying code

You can check out the following at Neil's Foxpro pages:
fox_lib.zip
FNKSHN (pronounced function) foxpro library version by Perry Fect is a set of freely distributable functions and utilities for FoxPro 2.6.

This has 2 functions called SAVEVIEW & LOADVIEW which convert a VIEW showing all the databases in their SELECT areas and Indices into prg code.

This is useful if you want to move files to a different hard disk.
You effectively save the VIEW to a prg file, find references to the old location and replace with the new location. Then rerun the prg to set up the new VIEW, which you can then save. Migration made easy.
 
Cricket:

You note that on Neil's FoxPro pages is the file 'fox_lib.zip', but you do not tell us where to find Neil's FoxPro pages, making it somewhat hard to find the zip file. lol

Could you enlighten those of us in this community who have no idea where to find this file as to exactly where it is??

And who is Perry Fect and where do we find his FNKSHN library?

Thanks,



mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Neil's Foxpro pages can be found at
See item 58.
Perry Fect is the author of these functions which he has made publicware. It is appropriate to acknowledge his work.

When I saw your reply, I asked to colleague to seek this info on Google to see if it was difficult to find. It took 15 seconds, - first result from Google when searching for 'fox_lib.zip'
 
cricket:

I never thought of checking Google as usually a single word search brings up thousands, if not millions of items to search through. Not very time effective at all. Except, of course, this one time.

My thought is that if someone references something for someone to look up, that all of the relevent data needed to find that info should, if possible, be provided at that time, even if that means telling someone to go to Google and hit the "I'm feeling lucky" button.

As for Perry Fect, it is very appropriate to credit him. No argument there.

The problem was that your post was somewhat confusing (even after re-reading it again and again) making me think at first glance that you were refering to two different things, 1) a zip file found on Neil's pages, and 2) a FNKSHN file by Perry. It is not at all clear that Perry's FNKSHN is itself within the zip file.

Anyhow, thanks for the link and the clarification. Now will go see what is there that I may be able to use or modify to in my programs. Many thanks.






mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top