Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP problem with dates
Message
From
30/11/2007 10:15:53
 
 
To
30/11/2007 08:13:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01272198
Message ID:
01272406
Views:
16
>>This is a contrived code sequence but illustrates my problem.
>>The following code fails on the second update. This is a puzzle to me since it is the same code repeated. Can someone tell me why? The error is:
>>
>>Microsoft Cursor Engine error '80040e21'
>>Multiple-step operation generated errors. Check each status value.
>>/tip/login/tippages/save_tippage_edits.asp, line 147
>>
>>
>>
>>< % . . .
>>	  oPage.Open sql, oConnection, adOpenKeyset, adLockBatchOptimistic, adCmdText
>>	  oPage.movelast
>>	  response.write(sql&"<br>")
>>	  response.write(oPage("st_name")&"<br>")
>>	  with oPage
>>  	   .fields("ss_scoping").value = formatdate2(request.form("ss_scoping"))
>>  	   .fields("s_scoping").value = formatdate2(request.form("s_scoping"))
>> 	   .fields("time_scoping").value = nz(request.form("time_scoping"))
>> 	   .fields("as_scoping").value = formatdate2(request.form("as_scoping"))
>> 	   .fields("a_scoping").value = formatdate2(request.form("a_scoping"))
>>	   .updatebatch
>>
>>	   .fields("ss_scoping").value = formatdate2(request.form("ss_scoping"))
>>  	   .fields("s_scoping").value = formatdate2(request.form("s_scoping"))
>> 	   .fields("time_scoping").value = nz(request.form("time_scoping"))
>> 	   .fields("as_scoping").value = formatdate2(request.form("as_scoping"))
>> 	   .fields("a_scoping").value = formatdate2(request.form("a_scoping"))
>>	   .updatebatch
>>          end with
>>% >
>>
>>
>>The data in question are date fields and most of them are blank but that doesn't explain why it would work the first time through and not the second.
>
>Blank is the problem IMHO. I don't know why but behavior is that it reports 'after'. I had some sample code (but where now) that shows an update actually does take place on first and it's second call that causes the it to fail, still error reporting timing is irrelevant. It happens when it has to do with identifying the rows (it can before the change but after the first change more than a row has same column values - rows cannot be identified uniquely).
>Cetin

Cetin -
Thanks
I should have included the function in my example. It is based on help you gave me previously.
function formatdate2(lddate)
if isdate(lddate) then
   formatdate2 = lddate
else
  set oRS = oConnection.Execute("select {} as blankdate from users")
  session("blankdate") = oRS.Fields("blankdate").Value
  formatdate2 = session("blankdate")
  oRS.close
  set oRS = nothing
end if	   
end function
My real code did not have multiple updates and of course does not set the same fields twice. But I found that it would fail on the update. So for troubleshooting I added multiple updates to identify the field that was giving the problem. The frustrating thing is that it will sometimes work but usually not even with the same data.
Previous
Reply
Map
View

Click here to load this message in the networking platform