.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
asp调用存储过程出现错误 '800a0bb9'

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

create PROCEDURE dbo.sp_InsertSo
    (
     @cust_name varchar(120)
    )
    AS
    BEGIN
     INSERT INTO dbo.so (cust_name)
     VALUES (@cust_name)

    END

asp:
set cmd=server.CreateObject ("adodb.command")
set cmd.ActiveConnection=conn
cmd.CommandText="{call sp_InsertSo(?)}"
cmd.Parameters.Append cmd.CreateParameter("@cust_name",adInteger,adParamInput)
cmd("@cust_name")="999"
cmd.Execute()

 

ADODB.Command 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
出错行:cmd.Parameters.Append cmd.CreateParameter("@cust_name",adInteger,adParamInput)

用baidu找了半天找不到解决方法,用google搜索英文网站找到:

(a)  put <% Option Explicit %> at the top of your code
(b)  In case if you have not included, include ADO Type library or ADOVBS.inc at the top of your page.

e.g.
<!-- METADATA TYPE="typelib"
    UUID="00000205-0000-0010-8000-00AA006D2EA4"
     NAME="ADO 2.5 Type Library"
-->

于是加上:
dim cmd
Dim adCmdSPStoredProc
Dim adParamReturnValue
Dim adParaminput
Dim adParamOutput
Dim adInteger
Dim iVal
Dim oVal
Dim adoField
Dim adVarChar

'这些值在 VB 中是预定义常量,可以直接调用,但在 VBScript 中没有预定义
adCmdSPStoredProc = 4
adParamReturnValue = 4
adParaminput = 1
adParamOutput = 2
adInteger = 3
adVarChar = 200

iVal = 5
oVal = 3


执行成功




相关文章

相关软件