Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter
Message
De
19/03/2009 15:11:18
 
 
À
19/03/2009 14:58:50
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Vista
Database:
Firebird
Application:
Desktop
Divers
Thread ID:
01389669
Message ID:
01389729
Vues:
55
>Man, the changes that you've made in TableUpdate solve the problem!
>Why?
>I've tried many times setting all rows and force parameters without success...

A?

I just set all parameters I think TABLEUPDATE() needs esp. the ALIAS parameter.
Don't use VFP base CA class, build your own and have all basic logic in it.
Also have at least one method in it:
UpdateTable() thah have this:
LOCAL lbRetVal
lbRetVal = .t.
IF NOT TableUpdate(1, .t., this.Alias)
   AERROR(laError)
   MessageBox("Can not update "+this.Alias+", because:"+CHR(13)+;
              laError[1,2])
   lbRetVal = .f.
ENDIF
RETURN lbRetVal
and than instead of calling TABLEUPDATE call:
IF NOT CAInstance.UpdateTable()
   *** Logic if you can't update the table
ELSE
   *** Logic if you can update the table
ENDIF
Of course you can construct that method as you wish, to pass first two parameters that TABLEUPDATE() receives, but the last one ALWAYS should be [this.Alias].

Simplified method that we have in our class looked like this:
LPARAMETERS lbUpdateAll, lbOverwrite, lbNOTShowMessage
IF PCOUNT() < 1
   lbUpdateAll = 1
ENDIF

IF PCOUNT() < 3
   lbOverwrite = .t.
ENDIF
*** lbNOTShowMessage is used as default - .f.

LOCAL lbRetVal, lcError
lbRetVal = .t.
IF NOT TableUpdate(lbUpdateAll, lbOverwrite, this.Alias)
   AERROR(laError)
   lcError = "Can not update "+this.Alias+", because:" + CHR(13) + laError[1,2]
   IF NOT m.lbNOTShowMessage
      MessageBox(lcError)
   ELSE
      **** Log the error
   ENDIF
   lbRetVal = .f.
ENDIF
RETURN lbRetVal
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