Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UpdateNameList
Message
From
07/01/2003 07:37:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00738407
Message ID:
00738704
Views:
31
Likes (1)
>You're right. They are not switched in my code, however. They should be:
>
> cursorsetprop('tables','dbName.dbo.tablename')
> cursorsetprop('keyfieldlist','Primary key')
> cursorsetprop('updateNameList','field1 tablename.field1')
> cursorsetprop('UpdatableFieldList','field1')
> cursorsetprop('sendupdates',.t.)

Gerry,
There's something I posted earlier :
"Though key field is not in updatablefieldlist include it in UpdateNameList, otherwise update doesn't occur". Maybe I'm wrong at some point but that's what I observed. Try the following sample (SQL server pubs) with and w/o having the au_id in updatenamelist :
lnHandle=SQLStringConnect('DRIVER=SQL Server;SERVER=SERVERNAMEHERE;DATABASE=pubs;Trusted_Connection=Yes')
SQLExec(lnHandle,'select * from authors','v_authors')
cursorsetprop('KeyFieldList','au_id','v_authors')
cursorsetprop('WhereType',1,'v_authors')
cursorsetprop('Tables','authors','v_authors')

CURSORSETPROP("UpdateNameList", ;
	"au_id authors.au_id,"+;
	"au_lname authors.au_lname,"+;
	"au_fname authors.au_fname",'V_authors')
* w/o key
* CURSORSETPROP("UpdateNameList", ;
	"au_lname authors.au_lname,"+;
	"au_fname authors.au_fname",'V_authors')

cursorsetprop('UpdatableFieldList','au_fname,au_lname','v_authors')
cursorsetprop('SendUpdates',.t.,'v_authors')
cursorsetprop('Buffering',5,'v_authors')
browse title 'Before Update' && Modify data
tableupdate(2,.t.,'v_authors')
SQLExec(lnHandle,'select * from authors','afterupdate')
SQLDisconnect(lnHandle)
select afterupdate
browse title 'After Update'
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