Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering
Message
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:
01193329
Vues:
12
>>>
>>>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.
>
>
>Where you keep the definition of THAT CA? If it is in PRG can you copy and paset the whole DEFINE CLASS section. If it is in VCX run Class Browser and generate the code for that class, paste it here.
>That error is because I am prety sure that you use TABLEUPDATE(...,...,[biditems]), but YOU MUST use TABLEUPDATE(...,...,[CA1])

It looks like he doesn't have CA as a separate class, see this.oCa = createobject([CursorAdapter])

For me everything looks OK, but I'm just used to Mark's builder, so I'm not specifying things in code as form's method does.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform