Trying to do something simple here, not working - I have added a command button to a data access page,and I want to execute a stored procedure when the button is clicked. Here is my code:
<SCRIPT language=vbscript event=onclick for=cmdAddAll>
<!--
constr=cnDBConn.Open "Driver={SQL Server};Server=SQL2;Uid=XXXXXX;Pwd=YYYYY;Database=WEBGUY;"
Set cn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
cn.Open constr
Set cmd.ActiveConnection = cn
cmd.CommandText = "dbo.DXP_WEB_USERS_updateAllLinks"
cmd.CommandType = adCmdStoredProc
' Ask the server about the parameters for the stored proc
cmd.Execute
-->
</SCRIPT>
The error I get is "SERVER: object required". The other programmer I am working with says you simply can't do this from an .htm page and I should rename it to .asp. Is he right? Is my code correct?
Thanks!
<SCRIPT language=vbscript event=onclick for=cmdAddAll>
<!--
constr=cnDBConn.Open "Driver={SQL Server};Server=SQL2;Uid=XXXXXX;Pwd=YYYYY;Database=WEBGUY;"
Set cn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
cn.Open constr
Set cmd.ActiveConnection = cn
cmd.CommandText = "dbo.DXP_WEB_USERS_updateAllLinks"
cmd.CommandType = adCmdStoredProc
' Ask the server about the parameters for the stored proc
cmd.Execute
-->
</SCRIPT>
The error I get is "SERVER: object required". The other programmer I am working with says you simply can't do this from an .htm page and I should rename it to .asp. Is he right? Is my code correct?
Thanks!