Solved

Set Index on a non index dbf

Posted on 2010-11-16
5
477 Views
Last Modified: 2012-05-10
I select MyTable.dbf and it has 4 fields, fld1, fld2, fld3, fld4

no index I seen the othe day an Exper was typing to set index on xxx TAG sort order then select I beleive.

can any one clarify?
OPEN DATABASE C:\MyFolder\Data\DB.dbc SHARED
* Set Index
	Index On fld1 + fld2 + fld3 TAG sortorder
	Select * ;
	from MyTable ;
	order By fld1, fld2 Into Cursor cMycursor Readwrite

	Browse

Thanks

Scan
....
ENDSCAN

Open in new window

0
Comment
Question by:jaymz69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 2

Accepted Solution

by:
Gary2Seven earned 250 total points
ID: 34146029
You can either index your original table

USE MyTable Exclusive
INDEX ON fld1 TAG fld1

Open in new window


OR you can sort as you select
Select * ;
from MyTable ;
order By fld1 Into Cursor cMycursor Readwrite

Open in new window


OR if you want multiple indexes in your result you would have to:
Select * ;
from MyTable ;
Into Cursor cMycursor Readwrite
INDEX ON fld1 TAG fld1
INDEX ON fld2 TAG fld2
...

Open in new window

Then set the index to whichever you want to use
SET ORDER TO fld1
...
SET ORDER TO fld2
....

Open in new window

0
 
LVL 12

Assisted Solution

by:jrbbldr
jrbbldr earned 250 total points
ID: 34146030
Select * ;
      from MyTable ;
      order By fld1, fld2 Into Cursor cMycursor Readwrite


Will create a Cursor.  
And that Cursor may be Ordered, but it has No Index on it
You need to create an Index on the Cursor after it is created.
Immediately after creating the Index it will be Active, but should you use the Cursor in a variety of ways, you will need to  SET ORDER TO <index tag>   to ensure that the particular index is Active

Good Luck


0
 
LVL 12

Expert Comment

by:jrbbldr
ID: 34146111
Also I have to agree with the comments of some of the other gurus (http://www.experts-exchange.com/Microsoft/Applications/FoxPro/Q_26612003.html) in the numerous posts you have entered on the wide variety of VFP issues that you have needed help with.     It seems as though we have needed to assist you almost line-by-line on this entire project of yours.

In light of the almost line-by-line assistance that you have needed it might be well worth your while to Hire a VFP consultant to tutor you personally or to assist you in your project.

Good Luck
0
 

Author Comment

by:jaymz69
ID: 34146631
Is that what this is not for?

Thanks again for all your input...
0
 
LVL 12

Expert Comment

by:jrbbldr
ID: 34147189
"Is that what this is not for?"

The forum is to provide assistance to users who need it from time-to-time, but when that level of assistance goes to the line-by-line for an entire project, it could easily be considered excessive and justifying your getting more detailed line-by-line assistance through a contracted professional.

If you look at your other positing which I referenced above you will see where other top-rated gurus for this site have made previous similar comments.

Good Luck
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question