-
VB script Question
<P><INPUT name="Update_Records" onclick="Update_Records" type="Button" value="Update Data"></P>
<%
Function Update_Records_onClick()
Set Cmd = server.CreateObject ("ADODB.Command")
Set Cmd.ActiveConnection=MyConnection
...
...
...
Response.write "Records are updated"
%>
I want to use a command button, when clicked, should execute the function. Well nothing is happening, it is not calling the function. What am I doing wrong??
In the code for the button, onclick: I tried writing "Update_Records", Update_Records, Update_Records(), "Update_Records()".... Nothing worked
-
You are trying to do database updates from the client side. The database is on your server.
You will need to make your button call your page and put a conditional check to see whether the page has been called by itself or not, and if so, do the update in server side ASP code.