Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursorsetprop(buffering,5,0) and create cursor ??
Message
De
11/06/2004 03:59:15
 
 
À
11/06/2004 00:27:30
Suhas Hegde
Dental Surgeon
Sirsi, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00912173
Message ID:
00912562
Vues:
26
Hi Suhas,

>Why would U make the cursors behave differently other than tables ?
>

In fact, cursors do not behave differently in this scenario. They behave exactly like tables. CREATE CURSOR command should be compared to CREATE TABLE command and USE should be compared to USE. Here is the code:
SET MULTILOCKS ON
CLOSE DATABASES all
CLEAR 
DELETE FILE testBufferingCreate.dbf
CURSORSETPROP("Buffering",5,0)

?[CURSORGETPROP("Buffering",0)],CURSORGETPROP("Buffering",0)
?
?"With Cursor"
CREATE CURSOR testBufferingCreate(f1 I)
?ALIAS(),CURSORGETPROP("Buffering")
USE DBF("testBufferingCreate") IN 0 AGAIN ALIAS testBufferingUSE
SELECT testBufferingUSE
?ALIAS(),CURSORGETPROP("Buffering")
CLOSE TABLES ALL 
?
?"With Table"
CREATE TABLE testBufferingCreate (f1 I)
?ALIAS(),CURSORGETPROP("Buffering")
USE
USE testBuffering ALIAS testBufferingUSE
?ALIAS(),CURSORGETPROP("Buffering")
Result:
CURSORGETPROP("Buffering",0)          5

With Cursor
TESTBUFFERINGCREATE          1
TESTBUFFERINGUSE          5

With Table
TESTBUFFERINGCREATE          1
TESTBUFFERINGUSE          5
Why CREATE command behaves differently by comparison to USE? I don't know for sure. Perhaps because the assumption was made that, after the table/cursor is created, some other DDL operations will likely to be performed (INDEX ON ..., etc). And some of those operations are not allowed when table buffering is in effect.


I would really like to understand what did you mean by the following statement:

>>Other wise what would be the use in making a cursor transactable? when this does not defaults to 5 and should always be set manually

Are you saying that it is useless to make a cursor transactable unless it is in table buffering mode? Why do you think so?

Thanks,
Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform