Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP OleDB Limits
Message
 
 
To
06/08/2002 23:10:07
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00685953
Message ID:
00687694
Views:
46
First, LockBatchOptimistic should be used with UpdateBatch() method. Second, there seems to be a limit on the number of fields that can be included in update. I couldn't find it documented anywhere but it's around 80. Take a look at mskb #Q190727 HOWTO: Control Your Updates in ADO Through "Update Criteria". If you're only updating a few fields than you can make update work by creating primary key on the table.

>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
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform