ASP calls data fixing process

zhaozj2021-02-11  196

ASP calls data fixing process

<% Set dataconn = server.createObject ("adoDb.connection") 'establishes connection object Dataconn.open "DSN = sinotrans; server = app_server; uid = sa; pwd =; app = microsoft (r) developer studio; wsid = app_server ; Regional = yes "set cmdtemp = server.createObject (" adoDb.command ") 'Establishing a command object set = server.createObject (" adodb.recordset ")' Establish record set object cmdtemp.commandtext =" dbo.Pd_test "' stored procedure names cmdTemp.CommandType = 4 'command category 4, as represented by a stored procedure Set cmdTemp.ActiveConnection = DataconnSet tmpParam = cmdTemp.CreateParameter ( "Return Value", 3, 4, 4) cmdTemp.Parameters.Append tmpParamSet tmpParam = cmdTemp .CreateParameter ("@ Begindate", 135, 1, 16, riqi) Create input parameter object cmdtemp.parameters.Append Tmpramrst.open cmdtemp,, 1, 3 'Generate Query Result%> The stored procedure called PD_TEST, this Among the standard methods provided in ADO, there is a problem, that is, when there are more than two SELECT statements during the stored procedure, the ADO will prompt your storage procedure too much. Many, the solution is to directly execute the stored procedure directly with the Execute method of the ADO's Connection object, as follows: <% set DataConn = Server.createObject ("AdoDb.connection") 'Established connection objects Dataconn.open "DSN = sinotrans; server = App_server; UID = SA; PWD =; app = Microsoft (R) Developer Studio WSID = app_server; region = yes "ss =" execute dbo.pd_test "&" "& riqi1 &" "set = dataconn.execute (ss)%>

转载请注明原文地址:https://www.9cbs.com/read-4146.html

New Post(0)