Microsoft KB Archive/314650

= FIX: Error Updating Table with Empty Date Using VFP OLEDB Provider =

Article ID: 314650

Article Last Modified on 2/18/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q314650



SYMPTOMS
When you use the Visual FoxPro (VFP) 7.0 OLEDB provider to create an ActiveX Data Objects (ADO) recordset on a Visual FoxPro table that has a date-type field, the following error may occur when you use the ADO UPDATE method to update the values in a record that contains an empty date-type field:

Multiple-step operation generated errors. Check each status value.

This error occurs even if you do not attempt to modify the value of the date-type field in the record.



RESOLUTION
To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack



STATUS
Microsoft has confirmed that this is a problem in Microsoft Visual FoxPro for Windows 7.0. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.



Steps to Reproduce Behavior
To reproduce the problem, paste the following code in a new program (.prg) file and run it: ON ERROR DO ERR_HAND

CLEAR CD JUSTPATH(SYS(16)) LOCAL loCONN AS ADODB.Connection, ; loRS AS ADODB.Recordset, ; lcConnStr as String

ERASE MyDBF.* CREATE TABLE MyDBF (sys_cust N(8), cust_no c(6), ddate d) INSERT INTO MyDBF VALUES (12345678,&quot;CUST12&quot;,{}) USE IN MyDBF

lcConnStr = [Provider=VFPOLEDB.1;Data Source=] + JUSTPATH(SYS(16,0)) loCONN = CREATEOBJECT(&quot;ADODB.Connection&quot;) loRS = CREATEOBJECT(&quot;ADODB.Recordset&quot;)

loCONN.Mode = 12 loCONN.CursorLocation = 3 loCONN.OPEN(lcConnStr)

WITH loRS .OPEN(&quot;select * from MyDBF&quot;, loCONN, 1, 3) .FIELDS(0) = 543543 .FIELDS(1) = &quot;222001&quot; .FIELDS(2)= DATE .UPDATE .CLOSE ENDWITH loRS = NULL loCONN.CLOSE loCONN = NULL

RELEASE ALL WAIT WINDOW &quot;Update successful...&quot; NOWAIT NOCLEAR USE MYDbf BROWSE USE IN SELECT(&quot;MYDBF&quot;) WAIT CLEAR

PROCEDURE ERR_HAND ON ERROR AERROR(aTest) _CLIPTEXT = aTest(3) DISPLAY MEMORY LIKE aTEST RELEASE ALL CLOSE DATABASES ALL CLEAR ALL CANCEL When you run this code using the VFP 7.0 version of the VFP OLEDB Provider, the error mentioned in the &quot;Symptoms&quot; section occurs. When you use the VFP 7.0 SP1 version of the VFP OLEDB Provider, no error occurs and the UPDATE call is successful.

Additional query words: kbVFP700sp1fix

Keywords: kbbug kbfix kbcodesnippet KB314650

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.