ASP Database Fundamentals (Part 4) - Updating Using the Connection Object
(Page 6 of 9 )
As illustrated when we discussed inserting records into the database, the execute method of the connection object can be used to execute a correctly constructed SQL statement. By using this method, you can quickly and easily update database records without the need or overhead of creating a recordset object.
For example:
<%
ConnectionString = "DSN=MyDB”
set conn = server.createobject("adodb.connection")
conn.open ConnectionString
mySql = “Update Customers set Status = ‘Active’, “ & _
“Profile = ‘Visible’ where CustomerNo = 10”
conn.execute mySql
conn.close
set conn = nothing
%>
Again, this method can be considered a little more daunting than using the recordset object, because it requires at minimum a fundamental knowledge of SQL. It is, however, one of the most efficient and powerful ways to manipulate your data.
Next: Deleting Information >>
More ASP Articles
More By Rich Smith