Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : adding records...ASP...via Recordset Object Signup · Login
Author Thread
adding records...ASP...via Recordset Object
Posted in tutorial: Adding records to the database with ASP
·  xbat
User
Joined: 9 Nov 2005
Total Posts: 2
adding records...ASP...via Recordset Object
Posted: 9 Nov 2005
I copied your suggested code for both ways to do it, The first via Connection works, but when I tried via Recordset I couldn't get it to work. I got the following error message:

"ADODB.Recordset error '800a0cb3'

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

/add_records_via_recordset.asp, line 14 "

ASP I used:
<%
' Setting variables
Dim rs, data_source

data_source ="provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("access_db/test_khan.mdb")
'access_db/test_khan.mdb is path and name of db
' Creating Recordset Object and opening the database
Set rs = Server.CreateObject("ADODB.Recordset")

' Lets open books table
rs.Open "books", data_source

rs.AddNew
' Now adding records
rs("author") = "Faisal Khan"
rs("title") = "Adding Records"
rs.Update

' Done. Now Close the Connection
rs.Close
Set rs = Nothing

%>

Any help would be appreciated greatly.

xbat
·  xbat
User
Joined: 9 Nov 2005
Total Posts: 2
Sorry
Posted: 9 Nov 2005
Sorry wrong code example. I got it to work...late night

xbat

Users Who Have Visited This Thread In Last 24 Hours
3 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.