Trying to call a stored procedure from JavaScript:
<script type="text/javascript">
<!--#include file="Connections/sms.asp" --开发者_开发百科>
var UpdateCalls = Server.CreateObject("ADODB.Command");
UpdateCalls.ActiveConnection = MM_sms_STRING;
UpdateCalls.CommandText = "CALL sms.UpdateCalls()";
UpdateCalls.CommandType = 4;
UpdateCalls.CommandTimeout = 0;
UpdateCalls.Prepared = true;
UpdateCalls.Execute();
</script>
I tested the stored procedure in MySQL and it executes correctly, but not from JavaScript. The syntax seems to be correct.
Any suggestions?
I got it.
var UpdateCalls = Server.CreateObject("ADODB.Command");
UpdateCalls.ActiveConnection = MM_sms_STRING;
UpdateCalls.CommandText = "sms.UpdateCalls()";
UpdateCalls.CommandType = 4;
UpdateCalls.CommandTimeout = 0;
UpdateCalls.Prepared = true;
UpdateCalls.Execute();
there is no need to put the CALL in commandtext, just the sproc name.
Thanks everyone.
精彩评论