ADODB.Recordset error "800a0cb3"

ADODB.Recordset error "800a0cb3"

am 04.09.2006 15:54:01 von morello

Hello Everybody,

I have the following ASP 3.0 code with Sqlserver 2000 Db:

<%
Dim ProvStrDb, OBJdbConnection
Dim RsRegistraAccesso, SqlRegistraAccesso

Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3

'---- LockTypeEnum Values ----
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4

'Connessione a db SqlServer
ProvStrDb = "Server=BOSS;Database=termomeccanica;Trusted_Connection=yes; "

Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Provider = "sqloledb"
OBJdbConnection.Open ProvStrDb


SqlRegistraAccesso="Select Top 1 IdAdm, IdAzienda, Username, Password,
SessionId, AccessKey, " &_
"Username, Login, Accesso, mSec, Ip, Browser, Alert From TblAdmLog"

Set RsRegistraAccesso = Server.CreateObject("ADODB.Recordset")
RsRegistraAccesso.Open SqlRegistraAccesso, OBJdbConnection, 2, 3

RsRegistraAccesso.AddNew ' ROW 30ERROR ERROR

Response.End
%>


The system return the following error at row 30:

ADODB.Recordset error '800a0cb3'

Il set di record corrente non supporta l'aggiornamento. Potrebbe trattarsi
di una limitazione del provider o del tipo di blocco selezionato.

/prova.asp, line 30



I try to use different provider type and different cursor block type but
nothing.....


If i use :
StrSqlUpdate = " UPDATE tblAdm SET Cognome = N'fasdfsafas' WHERE (IdAdm
= 1)"
OBJdbConnection.Execute (StrSqlUpdate)

It's Works !!!!

Thanks For Your Help !

Re: ADODB.Recordset error "800a0cb3"

am 04.09.2006 17:13:08 von reb01501

morello wrote:
> Hello Everybody,
>
> I have the following ASP 3.0 code with Sqlserver 2000 Db:
>

>
> SqlRegistraAccesso="Select Top 1 IdAdm, IdAzienda, Username, Password,

"Password" is a reserved keyword: http://www.aspfaq.com/show.asp?id=2080

I strongly recommend changing the name of that column, but if, for some
reason, that is not possible, then you will need to remember to surround it
with brackets [] when using it in queries run via ADO:

SqlRegistraAccesso= _
"Select Top 1 IdAdm, IdAzienda, Username, [Password], ...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"