Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programatically Setting updatable Fields in Remote view

Status
Not open for further replies.

madhatter2002

Programmer
Nov 6, 2002
73
PH
How about another client-server questions for our tipsters?

I created a remote view from a certain table located in one of our servers..

Question is this, how can I programatically set the fields for updating this remote view??

I know how to do this using the remote view designer.. but I was wondering, how this is done programatically.

Thanks for your tips.
 
Madhatter,

You need to set the following properties:

KeyField
Updatable
SendUpdates
WhereType
UpdateType

Use DBSETPROP() to set those properties. See the Help for more information.

Come back if you get stuck. I might be able to find some sample code.

Mike


Mike Lewis
Edinburgh, Scotland
 
Here is an example of what I use very successfully:

CREATE SQL VIEW install_equip AS SELECT Service.cust_no, Service.order_no, Service.type_work, Service.tech_no, Service.verby, Service.verto, Service.verdate, Service.podate, Service.n1, Service.job, Service.ponum, Service.tech_name, Service.company, Service.closed, Service.sched, Service.when, Service.equip, Service.date_ord, Service.problems, Service.work, Service.dropship, Service.mail, Service.selector, Service.CreditOk FROM sys2000!service WHERE Service.equip = "A" OR (Service.equip = "K") ORDER BY Service.date_ord, Service.order_no

STATUS.txtStatus.Value="Updating Install_Equip..."

=Set_Updateable3("install_equip")

&& Notice the last line =Set_Updateable3("install_equip")

Here is the sub proc for that update

PROCEDURE Set_Updateable3
LPARAMETERS cTablename
cTablename=ALLT(cTablename)
DBSETPROP(cTablename+".order_no", "field", "KeyField", .T.)
DBSETPROP(cTablename, "view", "WhereType", 1)
DBSETPROP(cTablename, "view", "SendUpdates", .T.)
DBSETPROP(cTablename+".cust_no", "field", "Updatable", .F.)
DBSETPROP(cTablename+".order_no", "field", "Updatable", .F.)
DBSETPROP(cTablename+".type_work", "field", "Updatable", .F.)
DBSETPROP(cTablename+".n1", "field", "Updatable", .F.)
DBSETPROP(cTablename+".job", "field", "Updatable", .F.)
DBSETPROP(cTablename+".company", "field", "Updatable", .F.)
DBSETPROP(cTablename+".creditok", "field", "Updatable", .T.)
ENDPROC

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top