Jump to content

updating / adding records to a database


Splurd

Recommended Posts

Basicly I found two diffrent ways to do it, from browing the various tutorials.

Set rsAddComments = Server.CreateObject("ADODB.Recordset")strSQL = "SELECT sg_test.* FROM sg_test;"rsAddComments.Open strSQL, adoCon, 3 , 3rsAddComments.AddNewrsAddComments.Fields("SN") = Request.Form("SN")rsAddComments.Fields("COUNTRY") = Request.Form("COUNTRY")	rsAddComments.Fields("MF_CODE") = Request.Form("MF_CODE")	rsAddComments.Fields("MF_NAME") = Request.Form("MF_NAME")	rsAddComments.Fields("ADDRESS") = Request.Form("ADDRESS")	rsAddComments.UpdatersAddComments.CloseSet rsAddComments = Nothing

Then in the w3schools ado section there was this methodhttp://www.w3schools.com/ado/ado_update.aspSo whats the difference between the two and which is better /easier. For both adding a new record to a data base and editing/updating an existing record

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...