Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP OleDB Limits
Message
From
06/08/2002 23:10:07
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00685953
Message ID:
00686860
Views:
37
This Code snippet will demo the problem. Constants were named and defined the same as you would find them in VB. Run this piece of code twice. Assume the value in the status field is currently nothing. First time replace the value in status field with 'It worked'. Second time through the value should already be 'It worked'. Unfortunately its not. During the second run the status field has its original value. With 81 or more fields in the RS the update does not succeed. With 80 or less the update succeeds.

ox = createobject( "adodb.connection" )
oy = createobject( "adodb.recordset" )

* Set up VFP oleDB
cDSN = "Provider=vfpoledb.1;Data Source=C:\data;Mode=ReadWrite"
ox.ConnectionString = cDSN
ox.Open

oy.ActiveConnection = ox
oy.CursorLocation = adUseClient
oy.CursorType = adOpenDynamic
oy.LockType = adLockBatchOptimistic

oy.open( "select * from books98 where recno() = 25")
if !oy.eof
* show the old value
=messagebox( oy.fields( "status" ).value )

* Change the value
oy.fields( "status" ).value = "Good test"

* Send the update through
oy.Update

* ask the rs to show us the value we put in it
* should display the value we put in.
=messagebox( oy.fields( "status" ).value )
oy.close

endif

release ox
release oy
Terry Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net

If at first you don't succeed, then skydiving definitely isn't for you.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform