By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

Current Recordset does not support updating.

P: n/a
(closest newsgroup I could find)
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the
provider, or of the selected locktype.
/asp_data3_add.asp, line 30

<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsAddComments 'Holds the recordset for the new record to be added
Dim strSQL 'Holds the SQL query to query the database
'1Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'2Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("t.mdb")

'3Create an ADO recordset object
Set rsAddComments = Server.CreateObject("ADODB.Recordset")

'4Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT last, first FROM main;"

'5 Set the cursor type we are using so we can navigate through the
recordset
rsAddComments.CursorType = 2

'Set the lock type so that the record is locked by ADO when it is updated
'rsAddComments.LockType = 3
'Open the recordset with the SQL query
rsAddComments.Open strSQL, adoCon

'Tell the recordset we are adding a new record to it
rsAddComments.AddNew

'Add a new record to the recordset
rsAddComments.Fields("last") = Request.Form("last")
rsAddComments.Fields("first") = Request.Form("first")
'Write the updated recordset to the database
rsAddComments.Update

'Reset server objects
rsAddComments.Close
Set rsAddComments = Nothing
Set adoCon = Nothing

'Redirect to the guestbook.asp page
'Response.Redirect "asp_data2.asp"
%>

Dec 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The good newsgroup for a question about databases and ASP would be
microsoft.public.inetserver.asp.db

Second, using the old ODBC driver is probably not the best idea; you should
use the OLEDB provider instead.

Third, you must make sure that in your Select statement, the primary key for
the table has been selected (and that your table has a primary key defined,
of course).

Fourth, using constant such as CursorType = 2 without writing a notice
about its definition is not the best thing to do. Personally, I don't
remember at all the definition of 2 and of 3 in this context.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"barret bonden" <ar****@networks-cc.com> wrote in message
news:9M*****************@fe08.lga...
(closest newsgroup I could find)
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of
the
provider, or of the selected locktype.
/asp_data3_add.asp, line 30

<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsAddComments 'Holds the recordset for the new record to be added
Dim strSQL 'Holds the SQL query to query the database
'1Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'2Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("t.mdb")

'3Create an ADO recordset object
Set rsAddComments = Server.CreateObject("ADODB.Recordset")

'4Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT last, first FROM main;"

'5 Set the cursor type we are using so we can navigate through the
recordset
rsAddComments.CursorType = 2

'Set the lock type so that the record is locked by ADO when it is
updated
'rsAddComments.LockType = 3
'Open the recordset with the SQL query
rsAddComments.Open strSQL, adoCon

'Tell the recordset we are adding a new record to it
rsAddComments.AddNew

'Add a new record to the recordset
rsAddComments.Fields("last") = Request.Form("last")
rsAddComments.Fields("first") = Request.Form("first")
'Write the updated recordset to the database
rsAddComments.Update

'Reset server objects
rsAddComments.Close
Set rsAddComments = Nothing
Set adoCon = Nothing

'Redirect to the guestbook.asp page
'Response.Redirect "asp_data2.asp"
%>

Dec 13 '05 #2

P: n/a
You are in the wrong newgroup this is ASP.NET
Please post to ASP newgroup

"barret bonden" <ar****@networks-cc.com> wrote in message
news:9M*****************@fe08.lga...
(closest newsgroup I could find)
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/asp_data3_add.asp, line 30

<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsAddComments 'Holds the recordset for the new record to be added
Dim strSQL 'Holds the SQL query to query the database
'1Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'2Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("t.mdb")

'3Create an ADO recordset object
Set rsAddComments = Server.CreateObject("ADODB.Recordset")

'4Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT last, first FROM main;"

'5 Set the cursor type we are using so we can navigate through the
recordset
rsAddComments.CursorType = 2

'Set the lock type so that the record is locked by ADO when it is updated 'rsAddComments.LockType = 3
'Open the recordset with the SQL query
rsAddComments.Open strSQL, adoCon

'Tell the recordset we are adding a new record to it
rsAddComments.AddNew

'Add a new record to the recordset
rsAddComments.Fields("last") = Request.Form("last")
rsAddComments.Fields("first") = Request.Form("first")
'Write the updated recordset to the database
rsAddComments.Update

'Reset server objects
rsAddComments.Close
Set rsAddComments = Nothing
Set adoCon = Nothing

'Redirect to the guestbook.asp page
'Response.Redirect "asp_data2.asp"
%>

Dec 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.