Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why update sql server table through remote view failed?
Message
From
28/10/2003 03:38:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/10/2003 00:41:43
Michale Chen
Shijiazhuang ZhiYuan Crop.
Shijiazhuang, China
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00843381
Message ID:
00843403
Views:
27
>Hello every:
>
> Why I update sql server table through romote view failed, my code like this:
>
>CREATE CONNECTION mytest DATASOURCE "myodbc" USERID "myuser" password "ok" dabase "sys"
>
>CREATE SQL VIEW t1090 remote conn mytest share AS SELECT * FROM codeupdate
>
>
>use t1090
>sele t1090
>
>
>=cursorsetprop("buffering",3,"t1090")
>=dbsetprop("t1090","view","updatetype",2)
>=dbsetprop("t1090","view","shareconnection",.t.)
>=DBSETPROP('t1090','View','Tables','codeupdate')
>=DBSETPROP('t1090.codenumber','Field','KeyField',.T.)
>=DBSETPROP('t1090.codeupdatekey','Field','UpdateName','codeupdate.codeupdatekey')
>=DBSETPROP('t1090.codeupdatekey','Field','Updatable',.T.)
>=DBSETPROP('t1090.codenumber','Field','Updatable',.T.)
>=DBSETPROP('t1090.codeupdatekey','Field','Defaultvalue','1000')
>=dbsetprop("t1090","view","sendupdate",.t.)
>=DBSETPROP('t1090','View','WhereType',2)
>
>
>=requery('t1090')
>
>
>sele t1090
>go top
>replace t1090.codeupdatekey with 1589
>
>local sss
>sss=.f.
>sss=tableupdate(.t.,.t.,'t1090')
>? sss
>if sss=.f.
>=messagebox("failure")
>endif
>
>
>
> when I update the var 'sss' return .t., but the sql server table didn't update at all,why? Thank you.

Db properties seem to be missing (ie: I couldn't see updatename for codenumber). Create your view using designer and then use home()+'tools\gendbc\gendbc' to get correct code.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform