【vfp开源代码栏目提醒】:网学会员为需要vfp开源代码的朋友们搜集整理了非自动更新.prg相关资料,希望对各位网友有所帮助!
CLEAR
CLOSE DATABASES ALL
LOCAL oCursor as CursorAdapter,aErrors[1]
OPEN DATABASE HOME(2)+"Data\TestData" SHARE
USE Customer ALIAS Customer SHARED IN 0
oCursor=NEWOBJECT("CursorAdapter")
*!* 属性设置
WITH oCursor
.AllowDelete=.T.
.AllowInsert=.T.
.AllowUpdate=.T.
.Alias="curCustomer"
.BufferModeOverride=5
.DataSourceType="Native"
.SelectCmd="SELECT Cust_ID,Company,Contact FROM Customer WHERE Country='Brazil'"
.DeleteCmd="DELETE FROM Customer WHERE Customer.Cust_ID=curCustomer.Cust_ID"
.InsertCmd="INSERT INTO Customer (Cust_ID,Company,Contact) "+;
"VALUES (curCustomer.Cust_ID,curCustomer.Company,curCustomer.Contact) "
.UpdateCmd="UPDATE Customer SET Customer.Company=curCustomer.Company,"+;
"Customer.Contact=curCustomer.Contact WHERE Customer.Cust_ID=curCustomer.Cust_ID"
.SendUpdates=.T.
ENDWITH
IF oCursor.CursorFill() &&建立临时表
REPLACE Company WITH "IT Dep,Bank of Construction" FOR Cust_ID="FAMIA"
?TABLEUPDATE(.T.)
oCursor.CursorRefresh() &&重新读取
BROWSE
ELSE
AERROR(aErrors)
=MESSAGEBOX(aErrors[2])
ENDIF