Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Impossible query
Message
De
19/02/2003 07:27:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/02/2003 00:42:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00752198
Message ID:
00754864
Vues:
23
>Dear Cetin,
>
>Was working on your code. Code is working fine on it's own, but on adapting it to my situation, I am having a problem indexing the cursors. Each cursor accepts only one index + tag. On the second index command, i get the error, 'filexyz.tmp is read-only'. Been working on this for quite a while, but can't seem to find out the reason why. Any solutions for me please ?
>
>Here's the code in question:
>Select Workhrs
>Index On workdate tag workdate
>Index On gangId Tag gangId && I get the error at the 2nd tag
>Index On BinToC(gangId)+Dtoc(workdate,1) tag workmain
>
>In my case, gangId is a character field.
>
>Thanks!
>
>Steve.

Steve,
In order to be able to create multiple indexes cursor needs to be a true readwrite cursor. If your cursors are result of SQL then to make them readwrite you have 2 options :
1) VFP7 and up
select ... into cursor CursorName readwrite
2) VFP5 and up :
select .... into cursor tempcursorname nofilter
use dbf('tempcursorname') in 0 again alias cursorname
select 'cursorname'

ie:
SELECT * from customer INTO CURSOR crsTemp
Use Dbf("crsTemp") IN 0 AGAIN Alias crsCust
Use In "crsTemp"
SELECT crsCust && This cursor is readwrite
INDEX ON cust_id TAG cust_id
INDEX ON company TAG company
INDEX ON title TAG title
browse
However if you're already doing SQLs instead of indexing and xbase approach you might select the slower SQL approach (indexing overhead might close the gap).


>In my case, gangId is a character field.
Then make an expression like :
Index On gangId+Dtoc(workdate,1) tag workmain

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform