Solved

Size defined in Excel VBA

Posted on 2015-01-22
1
69 Views
Last Modified: 2015-02-08
In case the SQL Stored procedure input parameter is defined as NVARCHAR(MAX). How can I define the parameter in Excel VBA.

cmd.Parameters.Append cmd.CreateParameter("INVENTBATCHID", adVarChar, adParamInput, xxxx, stPar1)
0
Comment
Question by:AXISHK
1 Comment
 
LVL 18

Accepted Solution

by:
SimonAdept earned 500 total points
ID: 40565918
Although the stored proc will accept a huge chunk of text (up to 2GB), you can be more restrictive if you don't need to pass a very long value. It makes sense to restrict it if INVENTBATCHID is only intended to be a short string.

adLongVarWChar is the closest matching datatype
but you could use
adVarWChar for unicode text <4000 chars

See also the datatype enumeration reference
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now