Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot Insert Into Cursor
Message
De
26/05/1999 02:57:28
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00222602
Message ID:
00222807
Vues:
27
>>>I have created a cursor from another cursor, and I need to Insert one record at the end of the file.
>>>
>>>I set up the CursorSetProp("Buffering", 5, "cData"), and attempt to Insert the record, I get the error "Cannot Update The Cursor".
>>>
>>>MULTILOCKS is ON
>>>
>>>The code is as follows:
>>>IF CURSORSETPROP("Buffering", 5, "cData")
>>> INSERT INTO cData (cDep, nFlights) VALUES ("TOTAL", lnFlights)
>>>ENDIF
>>>
>>>TIA,
>>>Mark
>>
>>Mark
>>
>>How did you create it? Is it ReadOnly? If so use it again to make it RW.
>>
>>Macer
>
>I created the cursor using a SQLEXEC command for example:
>=SQLEXEC(gnFileHandle, "SELECT * FROM AC_Schedule", "cSQLFlightData")
>
>It is at this point, I need to make cSQLFlightData Read Write, so I can add one record.
>
>To make things a little bit more complicated, this is an Internet application and therefore do not want to create (if possible) any tables, I want to use views only.
>
>Is there a CursorSetProp("ReadOnly", .F.) ?
>
>Regards
>Mark



Mark this little func will make your cursor readwrite

Just pass in the cursor name as a parameter

************************************************************
FUNCTION TransformToReadWriteCursor( tcCursName)
************************************************************
LOCAL lcTempCurs
lcTempCurs = SYS(2015)

*-- Make it RW using use again...
SELECT 0
USE FULLPATH( DBF( tcCursName)) AGAIN ALIAS ( lcTempCurs)
USE IN ( tcCursName)

*-- Make sure it has the same name as when it entered
SELECT 0
USE FULLPATH( DBF( lcTempCurs)) AGAIN ALIAS ( tcCursName)
USE IN ( lcTempCurs)
SELECT ( tcCursName)

RETURN
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform