开发者

JavaScript call stored procedure

开发者 https://www.devze.com 2023-01-31 03:20 出处:网络
Trying to call a stored procedure from JavaScript: <script type=\"text/javascript\"> <!--#include file=\"Connections/sms.asp\" --开发者_开发百科>

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

精彩评论

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