应用程序对经典 asp 中的当前操作使用错误类型的值 [英] Application uses a value of the wrong type for the current operation in classic asp

查看:11
本文介绍了应用程序对经典 asp 中的当前操作使用错误类型的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码调用一个存储过程:

I am calling one stored procedure using the following code:

m_objCmd.CommandText = "StoredProc_Name"
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@UserID", 3, 1, 0, UserID)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@UserTypeID", 3, 1, 0, UserTypeID)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@AccessToken", 202, 1, 100, AccessToken)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@TokenExpiration", 135, 1, 0, TokenExpiration)
m_objCmd.Parameters.Append m_objCmd.CreateParameter("@RefreshToken", 202, 1, 100, RefreshToken)

rsUserData.Open m_objCmd, , adOpenStatic, adLockReadOnly  

在上面:

  • @UserID 是一个int"数据类型
  • @UserTypeID 是 'int'
  • @AccessToken 是 nVarchar(100)
  • @TokenExpiration 是数据时间(2)
  • @RefreshToken 是 nVarchar(100)
  • @UserID is a 'int' dataType
  • @UserTypeID is 'int'
  • @AccessToken is nVarchar(100)
  • @TokenExpiration is datatime(2)
  • @RefreshToken is nVarchar(100)

但在这里我得到了错误:

But here I am getting the error:

应用程序为当前操作使用了错误类型的值.

Application uses a value of the wrong type for the current operation.

谁能帮帮我.

推荐答案

几天前我也遇到了同样的问题.正如 Kul-Tigin 下面建议的那样,我的问题是溢出.

I had this same problem just a few days ago. My problem was overflow as Kul-Tigin suggests below.

我试图插入一个长度超过 17,000 个字符的巨大字符串,但收到的错误与您完全相同.然后我选择将字符串保存在一个文本文件中,并使用该表作为文件定位器.

I was trying to insert a huge string 17,000+ characters in length and I received exactly the same error as you. I then opted to save the string in a text file and I used the table as a file locator so-to-speak.

检查以下值的长度:

  • @UserID 是一个int"数据类型
  • @UserTypeID 是'int'
  • @AccessToken 是 nVarchar(100)
  • @TokenExpiration 是数据时间(2)
  • @RefreshToken 是 nVarchar(100)

这篇关于应用程序对经典 asp 中的当前操作使用错误类型的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆