access_asp thread: Re: Error Type: ADODB.Recordset (0x800A0CB3) Object or provider is not capable of performing requested operation.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Elmer L. Espinosa" <elmerespinosa@y...>
Subject: [access_asp] Error Type: ADODB.Recordset (0x800A0CB3) Object or
provider is not capable of performing requested operation.
: just a quick one please I need your help, I get the error "Error Type:
: ADODB.Recordset (0x800A0CB3) Object or provider is not capable of
: performing requested operation" when I tried to use the rs.Addnew.
:
: Here's my Code:
:
: m_rsCause.Open sSQLCause, m_cnAssoc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You are opening the recordset with the default locktype, which is
adLockReadOnly. You need to open the recordset with an updateable locktype,
eg adLockOptimistic:
<%
objRS.Open strSQLCause, objConn, adOpenStatic, adLockOptimistic, adCmdText
%>
Always open a recordset using a connection *object*, not a connection
*string*, otherwise you lose all the benefits of connection pooling:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q191572
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmdac/html
/pooling2.asp
Lastly, have you considering avoiding the recordset altogether, and using an
SQL statement instead:
<%
strSQL = _
"INSERT INTO table (Field1, Field2) VALUES ('value1', 3)"
objConn.Execute strSQL,,adCmdText+adExecuteNoRecords
%>
Cheers
Ken