开发者

JavaScript call stored procedure

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜