Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing from DBC unexpectedly
Message
From
16/04/2007 13:10:28
 
 
To
16/04/2007 11:39:13
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:
01216351
Views:
22
I found a solution: (this is only when working on main database, then other database is opened temporary to save some changes on tables, but you need to continue working on the main database)
*orders.dbf ->opened by dataenvironment
act_data=upper(dbc()) &&SAVE ORIGINAL DATABASE
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")
    insert into statistics (nord,date,....) values(num_ord,date(),....)
endif
begin transaction
if tableupdate(1,.T.,"orders")
    end transaction
    if used("est_orders")
    begin transaction
        if tableupdate(1,.t.,"est_orders")
            end transaction
        else
            rollback
            =tablerevert(.T.,"est_orders")
            messageb("Statistics can't be saved",16,"Error")
        endif
    endif
else
    rollback
    =tablerevert(.T.,"orders")
    messageb("Orders can't be saved",16,"Error")
endif
***RESTORING the database original
adatabases(adats)
for ix=1 to alen(adats,1)
    if upper(adats(ix,2))<>act_data
        set database to &adats(ix,2)
        close databases
    endif
endfor
set database to &act_data
***from here the database is going to show the same data
John Harold Belalcázar Lozano
Associate Director Of Development
http://www.belvicto.co/
jhbelalc@gmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform