I am having a look on an old web application written in the 90s in VB6 and Active Server Pages (JScript). The application retrieves some data from the database and stores it in a recordset which it is using to update. When it attempts to update a field (see below) it gives an '80040e21' error.
rsSave.Fields('text') = Request.Form('strText').Item(i); // this line fails
I have checked the type of the field and it is adVarWChar (202). I have checked the size of the 'text' field which is 2000, way bigger than what is comming from the form. I checked the status of all fields and they are all adFieldOK (0). In other words any of the usual suspects giving normally this error are ok.
The COM+ object that is creating, filling and then returning the recordset is doing the following:
'Initialize command object
Set oCmd = CreateObject("ADODB.Command")
With oCmd
.CommandType = adCmdText
.CommandText = strsql
End With
Set cn = CreateObject("ADODB.Connection")
'Open connection to database
cn.Open strConn
oCmd.ActiveConnection = cn
Set rs = CreateObject("ADODB.Recordset")
With rs
Set .Source = oCmd
.LockType = adLockBatchOptimistic
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open
Set .ActiveConnection = Nothing
End With
I tried using adLockOptimistic, but no luck.
Last but not least, this application was using initially an old Microsoft OleDb provider for Oracle that was no longer compatible with windows server 2008. We had to use a new provider and since then some things needed to be adjusted in order to work properly.
Any ideas?
oCmd
object where's the that? – Maxiestrsql
(can you see a pattern forming...)? Try not to add code into the comments, just edit the question and add the missing code. – Maxie