Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing from DBC unexpectedly
Message
 
 
À
16/04/2007 11:27:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01216225
Message ID:
01216269
Vues:
15
>
>*orders.dbf ->opened by dataenvironment
>if param.cstat=1 &&save statistics
>*check statistics file
>  cfi=alltrim(param.ordstatfile)
>  if file(cfi)
>    use (cfi) in 0 alias est_orders
>  endif
>endif
>cursorsetprop("Buffering",5,"orders")
>sele orders
>replace dmodi with date(), usmod with suser(), ....
>if used("est_orders") &&apply statistics
>  cursorsetprop("buffering",5,"est_orders")

** BTW, note, that you're inserting into Statistics, not into Est_Orders
>  insert into statistics (nord,date,....) values(num_ord,date(),....)
>endif
llError = .f.
>begin transaction
>if tableupdate(1,.T.,"orders")
>  if used("est_orders")
>    if tableupdate(1,.t.,"est_orders")
>      end transaction
>    else
>      rollback
>      =tablerevert(.T.,"est_orders")
       =tablerevert(.t.,'Orders')
>      messageb("Statistics can't be saved",16,"Error")
>    endif
   else && The est-orders is not used, save anyway?
    end transaction
>  endif
>else
>  rollback
>  =tablerevert(.T.,"orders")
>  messageb("Orders can't be saved",16,"Error")
>endif
>
See the changes I made. Why did you open and close transaction? You need to open transaction, save changes in both tables and then close it.
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