Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating empty cursor using SQLEXEC()
Message
 
 
To
23/07/2003 07:46:41
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00812705
Message ID:
00812747
Views:
12
Use a filter in the WHERE clause that can be optimized but returns no mathing records. For example, say I have a Primary Key field named KeyID and only contains positive integer numbers:

SELECT * FROM MyTable WHERE MyTable.KeyID = -1

That way you avoid a full table search. Just make sure there is an index on the field in the where clause.

>I have a grid on a form which is populated via. a cursor created via. a SQLEXEC() statement. When the grid is first displayed, I want the cursor to be present (so the grid can find the recordsource) but empty until the user performs a query (ie. the equivalent of cursor.noDataOnLoad=.T. if I had dragged a remote view from a .dbc into the form's dataenvironment). The most efficient way I can think of is to create the empty cursor is to run the SQLEXEC() in form.load with a WHERE .F. filter clause. Is there a faster/better way to achieve minium form instantiation time?
>
>Any help would be appreciated.
>
>Alan
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform