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

More on views... 1

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
Is there any way to access the parent table's indexes from within a view? In other words, while looking at the data in my view, I want to be able to change the order in which it is sorted. I was able to make a variable filter condition, but I can't figure out how to make the ORDER BY clause change to suit my needs like I could with a regular SQL statement. The View Designer will only let me pick the Order from a list, I cannot specify a variable to get the order from. Any ideas?
 
If you change to a straight query (no updates), then you can create an index on whatever order you choose. Otherwise, I believe you'll need to have a View for each Order by you think you'll need.

On the other hand, you could use the View Designer to build your "base" view, use GENDBC to show you the underlying code, and then build the View "on the fly" as you need it.

Rick
 
YOu can use the following ....
1. You can set the ORDER TO in the parent table and then
myKeyField = KEY()
2. You can also find the value with...
myKeyField = KEY(1) .. or KEY(2) whatever...

Then in indexing the view, you can query and craete the index with (mykeyFiel) or &myKeyField

Hope the idea helps ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Thanks, rgbean...your suggestion about GenDBC was great! I didn't know about that nifty tool. I was able to use that to solve a couple of problems. My other post where I'm having problems with the View Designer turning my filter expressions into strings when they are supposed to be datetime was also solved by this...using this I was able to create the SQL view exactly how I wanted by directly modifying the SQL code, then running it.
 
Of course, if I MODIFY the VIEW...it still puts the quotes and stuff on it...but it's fine as long as I don't save it...and I can just make changes to the .PRG file if I want to change the View itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top