Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quoted identifier equivalent in VFP?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01354077
Message ID:
01354206
Vues:
30
This message has been marked as the solution to the initial question of the thread.
Fckng DESC!!!!!!!!!!!!!
Try this:
CLOSE DATABASES ALL
IF NOT FILE([tblTest.DBF])
   CREATE TABLE tblTest (PK int, Date D, Type I, Desc C(20))
   USE
ENDIF

LOCAL oCA AS CursorAdapter 
oCA = CREATEOBJECT([cTest])
WITH oCA AS CursorAdapter 
     .SelectCmd = [SELECT PK, Date, Type, Desc AS Desc1 FROM tblTest]
     .Alias     = [crsTest]
     .UpdatableFieldList = [Pk, Date, Type, Desc1]
     .UpdateNameList = [Pk tblTest.Pk, Date tblTest.Date, Type tblTest.Type, Desc1 tblTest.Desc]
     .SendUpdates = .t.
     .WhereType = 1 
     .KeyFieldList = [Pk]
     .DataSourceType = [Native]
     .Tables         = [tblTest]
     IF NOT .CursorFill()
        AERROR(aaa)
        MESSAGEBOX(aaa[1,2])
        RETURN
     ENDIF
ENDWITH
BROWSE NORMAL && add few records here, just please add different values in PK field
? [aaaa]
IF NOT TABLEUPDATE(1, .t., [crsTest])
   AERROR(aaa)
   MESSAGEBOX(aaa[1,2])
ENDIF
TABLEREVERT(.t., [crsTest])
CLOSE DATABASES ALL



DEFINE CLASS ctest AS CursorAdapter

    PROCEDURE BeforeUpdate(cFldState, lForce, nUpdateType, cUpdateInsertCmd, cDeleteCmd)
    cUpdateInsertCmd = STRTRAN(cUpdateInsertCmd,[SET Desc],[SET tblTest.Desc])
    ENDPROC
ENDDEFINE
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform