|
|
|
|
|
| | |
Using An Update Query To Modify An Existing Record.
In this example we are using an update to modify an
existing record. The SQL statement is the key and by changing that you can update whatever
record you want to.
This is just an example to get you started.
<% ID = 1
%>
<%
' declaring variables
' not neccesary but a good habit
Dim DataConn
Dim CmdInsertRecord
Dim MYSQL
Set DataConn = Server.CreateObject("ADODB.Connection")
Set CmdInsertRecord = Server.CreateObject("ADODB.Recordset")
' The line below shows how to use a system DSN instead of a DNS-LESS connection
' DataConn.Open "DSN=System_DSN_Name"
DataConn.Open "DBQ=" & Server.Mappath("../_database/database.mdb")
& ";Driver={Microsoft Access Driver (*.mdb)};"
MYSQL = "UPDATE some_table SET NAME = 'Joe Bloe', EMAIL = 'Pizzaboy@bla.com' WHERE
(ID = " & ID & ")"
CmdInsertRecord.Open MYSQL, DataConn
' closing objects and setting them to nothing
' not neccesary but a good habit
DataConn.Close
Set DataConn = Nothing
%>
|
|
|
|
|
|
|
|
|
|