Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why update sql server table through remote view failed?
Message
De
28/10/2003 03:38:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/10/2003 00:41:43
Michale Chen
Shijiazhuang ZhiYuan Crop.
Shijiazhuang, Chine
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00843381
Message ID:
00843403
Vues:
28
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform