我以前用SQL语句生成XML文件,现在想在存储过程里对多个表进行整理,存到临时表里去,然后select * from #temp for xml auto,但是以前用SQL语句的时候cmdSer.Execute, ,1024 'cmdSer是一个command,执行的是一个sQL语句
现在command执行的是一个存储过程了,不能加1024参数了,我该怎么办呢?
谢谢。
...全文
2612打赏收藏
在ASP里用存储过程能生成XML文件吗?
我以前用SQL语句生成XML文件,现在想在存储过程里对多个表进行整理,存到临时表里去,然后select * from #temp for xml auto,但是以前用SQL语句的时候cmdSer.Execute, ,1024 'cmdSer是一个command,执行的是一个sQL语句 现在command执行的是一个存储过程了,不能加1024参数了,我该怎么办呢? 谢谢。
Parameters
RecordsAffected
Optional. A Long variable to which the provider returns the number of records that the operation affected. The RecordsAffected parameter applies only for action queries or stored procedures. RecordsAffected does not return the number of records returned by a result-returning query or stored procedure. To obtain this information, use the RecordCount property. The Execute method will not return the correct information when used with adAsyncExecute, simply because when a command is executed asynchronously, the number of records affected may not yet be known at the time the method returns.
Parameters
Optional. A Variant array of parameter values used in conjunction with the input string or stream specified in CommandText or CommandStream. (Output parameters will not return correct values when passed in this argument.)
Options
Optional. A Long value that indicates how the provider should evaluate the CommandText or the CommandStream property of the Command object. Can a bitmask of one or more CommandTypeEnum or ExecuteOptionEnum values.
Note Use the ExecuteOptionEnum value adExecuteNoRecords to improve performance by minimizing internal processing.
If adExecuteStream was specified, the options adAsyncFetch and adAsynchFetchNonBlocking are ignored.
Do not use the CommandTypeEnum values of adCmdFile or adCmdTableDirect with Execute. These values can only be used as options with the Open and Requery methods of a Recordset.
Constant Value Description
adCmdUnspecified -1 Does not specify the command type argument.
adCmdText 1 Evaluates CommandText as a textual definition of a command or stored procedure call.
adCmdTable 2 Evaluates CommandText as a table name whose columns are all returned by an internally generated SQL query.
adCmdStoredProc 4 Evaluates CommandText as a stored procedure name.
adCmdUnknown 8 Default. Indicates that the type of command in the CommandText property is not known.
adCmdFile 256 Evaluates CommandText as the file name of a persistently stored Recordset. Used with Recordset.Open or Requery only.
adCmdTableDirect 512 Evaluates CommandText as a table name whose columns are all returned. Used with Recordset.Open or Requery only. To use the Seek method, the Recordset must be opened with adCmdTableDirect.
This value cannot be combined with the ExecuteOptionEnum value adAsyncExecute.
adAsyncExecute 0x10 Indicates that the command should execute asynchronously.
This value cannot be combined with the CommandTypeEnum value adCmdTableDirect.
adAsyncFetch 0x20 Indicates that the remaining rows after the initial quantity specified in the CacheSize property should be retrieved asynchronously.
adAsyncFetchNonBlocking 0x40 Indicates that the main thread never blocks while retrieving. If the requested row has not been retrieved, the current row automatically moves to the end of the file.
If you open a Recordset from a Stream containing a persistently stored Recordset, adAsyncFetchNonBlocking will not have an effect; the operation will be synchronous and blocking.
adAsynchFetchNonBlocking has no effect when the adCmdTableDirect option is used to open the Recordset.
adExecuteNoRecords 0x80 Indicates that the command text is a command or stored procedure that does not return rows (for example, a command that only inserts data). If any rows are retrieved, they are discarded and not returned.
adExecuteNoRecords can only be passed as an optional parameter to the Command or Connection Execute method.
adExecuteStream 0x400 Indicates that the results of a command execution should be returned as a stream.
adExecuteStream can only be passed as an optional parameter to the Command Execute method.
adExecuteRecord Indicates that the CommandText is a command or stored procedure that returns a single row which should be returned as a Record object.
adOptionUnspecified -1 Indicates that the command is unspecified.