I have the following code:
<%
Dim Conn, RS, strSubmit, strDate, strName
strSubmit = Request("Submit"
If strSubmit <> "" Then
Submit = ""
strSubmit = ""
strName = "'" & Request("Name"
& "'"
strDate = "'" & Request("Date"
& "'"
' Opens SQL Connection
Set Conn = CreateObject("ADODB.Connection"
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.Open "\\exchange\requests\TRH IS Request.mdb"
' Creates the select statement
sql = "UPDATE tblScott"
sql = sql & " SET name = " & strName & " and date = " & strDate
response.write sql
' Runs the Query
Set rs = Server.CreateObject("ADODB.Recordset"
rs.Open sql, conn, 3, 3
End If
%>
<%
'Cleans up the connection
'Conn.Close
'set rs=nothing
%>
<head>
<title>TRH Support Center</title>
</head>
<body topmargin="0" leftmargin="0">
<form method="POST" action="test.asp">
<p><input type="text" name="name" size="20"></p>
<p><input type="text" name="date" size="20"></p>
<p><input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="B2"></p>
</form>
The database opens fine and the data gets wrote to the database. The problem is that it over writes the current row in the table.
Any ideas?
<%
Dim Conn, RS, strSubmit, strDate, strName
strSubmit = Request("Submit"
If strSubmit <> "" Then
Submit = ""
strSubmit = ""
strName = "'" & Request("Name"
strDate = "'" & Request("Date"
' Opens SQL Connection
Set Conn = CreateObject("ADODB.Connection"
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.Open "\\exchange\requests\TRH IS Request.mdb"
' Creates the select statement
sql = "UPDATE tblScott"
sql = sql & " SET name = " & strName & " and date = " & strDate
response.write sql
' Runs the Query
Set rs = Server.CreateObject("ADODB.Recordset"
rs.Open sql, conn, 3, 3
End If
%>
<%
'Cleans up the connection
'Conn.Close
'set rs=nothing
%>
<head>
<title>TRH Support Center</title>
</head>
<body topmargin="0" leftmargin="0">
<form method="POST" action="test.asp">
<p><input type="text" name="name" size="20"></p>
<p><input type="text" name="date" size="20"></p>
<p><input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="B2"></p>
</form>
The database opens fine and the data gets wrote to the database. The problem is that it over writes the current row in the table.
Any ideas?