MS Access VBA-MS SQL 2005 VARCHAR(MAX)参数 [英] MS Access VBA - MS SQL 2005 VARCHAR(MAX) parameter

查看:125
本文介绍了MS Access VBA-MS SQL 2005 VARCHAR(MAX)参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在SQL2005中具有定义为TEXT类型的列的现有项目.将其转换为后端的VARCHAR(MAX).这些都不是问题.但是在ADP前端,我要在过程之间传递参数,所以我不确定该使用什么.目前,我有:

Existing project that has a column defined as TEXT type in SQL2005. Going to convert it over to VARCHAR(MAX) in the backend. None of that''s an issue. But in the ADP front end, where I''m passing parameters to and from procedures, I''m not sure what to use. Currently, I have:

cmd.Parameters.Append cmd.CreateParameter("@BigVariable", adLongVarChar, adParamInput, -1, "sample text")



上面的已经工作好几年了.

我尝试在测试过程中使用相同的代码,但似乎可以正常工作,但是当我尝试返回varchar(max)参数时,出现一个错误,指出参数未正确定义.我在adp的proc上运行代码,以查看参数值是什么,类型"为200,大小"为2147483647.我尝试使用这些值代替adLongVarChar和-1,并得到了相同的错误.的定义不正确.

有趣的是,adLongVarChar是201,但这并不能说明任何问题.

谁能明确告诉我varchar(max)的参数类型是什么,输入或输出参数的大小是什么?

谢谢,

Keith



The above has been working fine for several years.

I tried using the same code in a test proc and it seems to work but when i try to return a varchar(max) param I get an error that the parameter is not properly defined. I ran code on the proc from the adp to see what the param values were and the "type" is 200 and the "size" is 2147483647. I tried using those values instead of adLongVarChar and -1 and got the same error that it''s not defined right.

Interestingly, adLongVarChar is 201 but that doesn''t really explain anything.

Can anyone tell me definitively what the param type is for varchar(max) and the size for either input or output params?

thanks,

Keith

推荐答案


在sql中,每个数据类型在MSACCESS VBA中都有各自的数据类型


http://www.w3schools.com/ado/ado_datatypes.asp [
Hi,
In sql every datatype has individual datatype in MSACCESS VBA


http://www.w3schools.com/ado/ado_datatypes.asp[^]


这篇关于MS Access VBA-MS SQL 2005 VARCHAR(MAX)参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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