I am looking at an old web application written in the 90s on VB6 and Active Server Pages (JScript). The application extracts some data from the database and stores it in the recordset that it uses to update. When he tries to update the field (see below), he gives the error "80040e21".
rsSave.Fields('text') = Request.Form('strText').Item(i);
I checked the type of the field and this is adVarWChar (202). I checked the size of the text field, which is 2000, the path is larger than the one that is submitted from the form. I checked the status of all fields, and all of them are adFieldOK (0). In other words, any of the usual suspects who usually give this error are okay.
The COM + object that creates, populates, and returns a set of records does 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 originally used the old Microsoft OleDb provider for Oracle, which was no longer compatible with Windows Server 2008. We had to use the new provider, and since then some things have to be set up in order to work properly .
Any ideas?
Midas source
share