Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering
Message
De
05/02/2007 10:44:44
 
 
À
02/02/2007 04:37:37
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:
01192413
Vues:
14
OK I can follow this except for the "?" in the select statement. I read the help but it was no help. Can you explain what the "?" does in simple terms? It looks like the code runs only once, so this is sort of like a permenant substitution.

Also, when the user edits the grid I need something to cause the new value to be saved back into the cursor and the source table. (This is my original problem.) What would that be?

- btw Thanks for your help here.

>Here some modifications:
>
>
>*** Form INIT EVENT:
>IF NOT thisform.DefineCA()
>   RETURN .f.
>ENDIF
>
>select CA1
>thisform.df_tabs1.df_page1.grdBiditems.recordsourcetype = 1
>thisform.df_tabs1.df_page1.grdBiditems.recordsource = "CA1"
>thisform.df_tabs1.df_page1.grdBiditems.column1.ControlSource = 'CA1.lineitemid_b'
>thisform.df_tabs1.df_page1.grdBiditems.column2.ControlSource = 'CA1.lineitemname_b'
>thisform.df_tabs1.df_page1.grdBiditems.column3.ControlSource = 'CA1.lineitemqty'
>thisform.df_tabs1.df_page1.grdBiditems.column4.ControlSource = 'CA1.lineitemest'
>
>********* END of INIT event of the form
>
>
>
>*** 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 = 3                && 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         = [test_financing]     &&
>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 bidirems.lineitemqty"
>
>m.lnValue = 0
>this.oCa.updatablefieldlist = "lineitemest, lineitemqty"
>this.oCa.alias              = "CA1"
>
>IF NOT this.oCa.cursorfill()
>   AERROR(laError)
>   MESSAGEBOX([Can not open CursorAdapter ] +laError[1,2])
>   RETURN .f.
>ENDIF
>RETURN .t.
>************* END OF DefineCA Method
>
>
>***** ComboBox InteractiveChange Event
>m.lnValue = val(this.value)
>IF NOT thisform.oCA.CursorRefresh()
>   AERROR(laError)
>   MESSAGEBOX([Can not refresh CursorAdapter ] +laError[1,2])
>   RETURN .f.
>ENDIF
>thisform.df_tabs1.df_page1.grdBiditems.Refresh()
>
>**** END of ComboBox InteractiveChange Event
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform