在ASP里用存储过程能生成XML文件吗?

jmf2000 2003-12-09 08:33:27
我以前用SQL语句生成XML文件,现在想在存储过程里对多个表进行整理,存到临时表里去,然后select * from #temp for xml auto,但是以前用SQL语句的时候cmdSer.Execute, ,1024 'cmdSer是一个command,执行的是一个sQL语句
现在command执行的是一个存储过程了,不能加1024参数了,我该怎么办呢?
谢谢。
...全文
26 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
甘泉123 2003-12-09
  • 打赏
  • 举报
回复
学习~
swich 2003-12-09
  • 打赏
  • 举报
回复
帮你顶
jmf2000 2003-12-09
  • 打赏
  • 举报
回复
我看了,好象不是我说的问题,我说的问题是怎么用存储过程来生成XML文件,或者说cmdSer.Execute 后面是否还有什么参数,我没有找到!
各位继续帮忙呀!谢谢了!
lqflsh 2003-12-09
  • 打赏
  • 举报
回复
是存储过程传值得问题哦。
http://www.py123.com/lqflsh/bbs/dispbbs.asp?boardID=37&replyID=129678&ID=3543&skin=1
jmf2000 2003-12-09
  • 打赏
  • 举报
回复
我自己顶!
cuipi2003 2003-12-09
  • 打赏
  • 举报
回复
关注ing
up
yonghengdizhen 2003-12-09
  • 打赏
  • 举报
回复
当然可以
jmf2000 2003-12-09
  • 打赏
  • 举报
回复
那么到底存储过程后面能不能带参数呢,不能的话我就放弃了
yonghengdizhen 2003-12-09
  • 打赏
  • 举报
回复
无非就是两个枚举常量的与运算
yonghengdizhen 2003-12-09
  • 打赏
  • 举报
回复
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.


综上所述,第三个参数应该为1028(0x404=adCmdStoredProc &&adExecuteStream)
leon168 2003-12-09
  • 打赏
  • 举报
回复
你所问的是不是就是CSDN的这种形式啊,去问问斑竹吧,他们也许知道
snowcloud2002 2003-12-09
  • 打赏
  • 举报
回复

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧