Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering
Message
De
07/02/2007 13:17:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01191514
Message ID:
01193316
Vues:
10
>
>Are you sure that all fields are properly specified as updatable?
>
>Here is a trick I use to test CA (and for some unknown reason I always end with it instead of starting with it):
>
>in the command window:
>
>o = newobject('myCAClass','myCa.lib')
>o.CursorFill()
>browse
>make changes
>?tableupdate(.t.,.t.)
>?o.cursorrefresh()
>
>
>Also examine your tables, if the changes were indeed saved.

Today is different from yesterday. I haven't a clue why.
I have verified that the new data is NOT being saved to the table. But now I am getting an error on tableupdate that reads:

"No key columns are specified for the table 'biditems'. Use the KeyFieldList property of the cursor."

Once again, here is the CA creation code:
*** Form DefineCA Method
this.addproperty('oCA')
this.oCa = createobject([CursorAdapter])

text TO this.oCa.SelectCmd PRETEXT 15 NOSHOW
       select * from biditems 
        inner join lineitemspecs 
        on biditems.lineitemid = lineitemspecs.lineitemid 
        where biditems.projectphaseid = ?m.lnValue
ENDTEXT

this.oCa.allowinsert        = .t.
this.oCa.insertcmd        = ""
this.oCa.buffermodeoverride = 5             		&& 3 = row buffering, 5 = table buffering
this.oCa.datasourcetype = [NATIVE]            		&& native fox datasource
this.oCa.sendupdates    = .t.                		&& unnecessary except with ODBC or ADO
this.oCa.wheretype      = 1                
this.oCa.tables         = [biditems,lineitemspecs] 
this.oCa.fetchsize      = -1               			&& primarily for remote views
this.oCa.keyfieldlist   = "biditemid"            	&& the primary key for the table
this.oCa.updatenamelist =     "lineitemest biditems.lineitemest," + ;
                              "lineitemqty biditems.lineitemqty"

m.lnValue = 0
this.oCa.updatablefieldlist = "lineitemest, lineitemqty"
this.oCa.alias              = "CA1"

IF NOT this.oCa.cursorfill()
   AERROR(laError)
   MESSAGEBOX([Cannot open CursorAdapter ] +laError[1,2])
   RETURN .f.
ENDIF
RETURN .t.
************* END OF DefineCA Method
Note that the KeyFieldList clearly specifies 'biditemid' as the primary key. This field IS a primary key in the table. The updateable fields are also clearly specified.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform