Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updatable SPT Cursors
Message
From
01/10/2005 05:07:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/09/2005 22:36:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01055169
Message ID:
01055205
Views:
11
>Hi Guys,
>
>I have a question regarding updatable SPT Cursors. I tried to set the cursor to be updatable and it worked on few table fields. But when the table starts to have more than ten fields, It does not update anymore. I wonder if they are limited to ten fields per cursor only though that does not seem to be logical. To give an example, here are the fields that I have been working for my dbo.sample table
>
>refuniqueno Char(10)
>trackno Char(10)
>field1 Char(10)
>field2 Char(10)
>field3 Char(10)
>field4 Char(10)
>field5 Char(10)
>field6 Char(10)
>field7 Char(10)
>field8 Char(10)
>
>these collection works fine. but when i include field9 from the list to have a total of 11 fields, the cursor won't update anymore. If I remove field1 and left field9 to give me 10 fields all in all, the cursor will update.
>
>Any idea or suggestion?
>
>Thanks in advance...

I don't know such a limit. This sample works fine for me:
Clear All
csql = "SELECT EmployeeID, LastName, FirstName," + ;
	"Title, TitleOfCourtesy, BirthDate," + ;
	"Hiredate, Address, City, Region," + ;
	"PostalCode, Country, HomePhone," + ;
	"Extension, Photo, Notes," + ;
	"ReportsTo, PhotoPath FROM dbo.Employees"

lnHandle=Sqlstringconnect('DRIVER=SQL Server;'+;
	'SERVER=server;DATABASE=Northwind;Trusted_Connection=Yes')
SQLExec(lnHandle,csql,'v_emp')

CursorSetProp('KeyFieldList','Employeeid','v_emp')
CursorSetProp('WhereType',1,'v_emp')
CursorSetProp('Tables','employees','v_emp')

TEXT to m.lcUpdateNameList noshow
employeeID  employees.employeeid,
Lastname employees.Lastname,
Firstname employees.FirstName,
Title employees.Title,
TitleOfCourtesy employees.TitleOfCourtesy,
BirthDate employees.BirthDate,
Hiredate employees.Hiredate,
Address employees.Address,
City employees.City,
Region employees.Region,
PostalCode employees.PostalCode,
Extension employees.Extension,
Notes employees.Notes,
ReportsTo employees.ReportsTo,
PhotoPath employees.PhotoPath
ENDTEXT
CursorSetProp("UpdateNameList", ;
	Chrtran(m.lcUpdateNameList,Chr(13)+Chr(10),''),'V_emp')

CursorSetProp('UpdatableFieldList',;
	"LastName, FirstName," + ;
	"Title, TitleOfCourtesy, BirthDate," + ;
	"Hiredate, Address, City, Region," + ;
	"PostalCode, Country, HomePhone," + ;
	"Extension, Notes," + ;
	"ReportsTo, PhotoPath",'v_emp')
CursorSetProp('SendUpdates',.T.,'v_emp')
CursorSetProp('Buffering',5,'v_emp')
Browse Title 'Editable fields are all except Id and Photo'
If !Tableupdate(2,.T.,'v_emp')
	Aerror(arrWhy)
	Display Memo Like arrWhy
Endif
SQLExec(lnHandle,'select * from dbo.employees','afterupdate')
SQLDisconnect(lnHandle)
Select afterupdate
Browse
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