Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing from DBC unexpectedly
Message
 
 
To
16/04/2007 11:27:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01216225
Message ID:
01216269
Views:
17
>
>*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
Previous
Reply
Map
View

Click here to load this message in the networking platform