Hi,

I am trying to update a MS Access database record, when an user clicks on a button in an ASP page.
Problem is - there are two buttons and ASP code related to both the buttons get executed when I click the button. I want that - sub related to the button should only be called when user clicks the button. Here is the code:

<%
Sub butEstopClick
Dim oConn Dim oRs
Dim filePath
filePath = Server.MapPath("test.mdb")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath

'Input_to_VB is a table name and Estop is field name
oConn.Execute "Update Input_to_VB Set Estop ='Yes'" _
& "where Estop='No' "
oConn.Close

End Sub


Sub butResetClick()
Dim oConn
Dim oRs
Dim filePath
filePath = Server.MapPath("test.mdb")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath

'Input_to_VB is a table name and Reset is field name
oConn.Execute "Update Input_to_VB Set Reset ='Yes'" _
& "where Reset ='No' "
oConn.Close
End Sub
%>

<INPUT type="button" value="ESTOP" id=butEstop name=butEstop onclick="<%butEstopClick%>" style="BACKGROUND-COLOR: red">

<INPUT type="button" value="RESET" id=butReset name=butReset onclick="<%butResetClick%>">