问题描述
我收到"溢出错误"并将其追溯到以下代码。它在最终的执行语句中出错。我查看了所有变量,参数(2)是37606,并想知道这是否是问题。我不知道adInteger的定义是什么,Access
帮助没有给出任何线索。该值完全在SQL 2000整数下但超过SQL 2000 smallint。我的机器上没有SQL 2000,因此无法查看sproc。
Dim cmd As New ADODB。命令
Dim param As ADODB.Parameter
设置cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdStoredProc
cmd.CommandText =" sFindRecLetter"
设置param = cmd.CreateParameter(" @ WHERE",adVarChar,adParamInput,250,gstrCriteria )
cmd.Parameters.Append param
设置param = cmd.CreateParameter(" @ Page",adInteger,adParamInput,Me!txtPage )
cmd.Parameters.Append param
设置param = cmd.CreateParameter(" @ RecordCount",adInteger,adParamOutput ,, 0)
cmd.Parameters.Append param
设置param = cmd.CreateParameter(" @ FirstRecord",adInteger,adParamOutput ,, 0)
cmd.Parameters.Append param
设置param = cmd.CreateParameter(" @ LastRecord",adIntege r,adParamOutput ,, 0)
cmd.Parameters.Append param
设置param = cmd.CreateParameter(" @ Pages",adInteger, adParamOutput ,, 0)
cmd.Parameters.Append param
cmd.Execute
I am getting "Overflow error" and traced it to the following code. It errors on the final execute statement. I looked at all the variables and parameter(2) is 37606 and was wondering if this is the problem. I dont know what adInteger is defined as, Access Help gives no clue. That value is well under SQL 2000 integer but exceeds SQL 2000 smallint. I don't have SQL 2000 on my machine so cannot look at the sproc.
Dim cmd As New ADODB.Command
Dim param As ADODB.Parameter
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "sFindRecLetter"
Set param = cmd.CreateParameter("@WHERE", adVarChar, adParamInput, 250, gstrCriteria)
cmd.Parameters.Append param
Set param = cmd.CreateParameter("@Page", adInteger, adParamInput, , Me!txtPage)
cmd.Parameters.Append param
Set param = cmd.CreateParameter("@RecordCount", adInteger, adParamOutput, , 0)
cmd.Parameters.Append param
Set param = cmd.CreateParameter("@FirstRecord", adInteger, adParamOutput, , 0)
cmd.Parameters.Append param
Set param = cmd.CreateParameter("@LastRecord", adInteger, adParamOutput, , 0)
cmd.Parameters.Append param
Set param = cmd.CreateParameter("@Pages", adInteger, adParamOutput, , 0)
cmd.Parameters.Append param
cmd.Execute
这篇关于Access 2010 ADP:执行SQL 2000 sproc时出现溢出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!