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.