Solved

Size defined in Excel VBA

Posted on 2015-01-22
1
72 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:
Simon 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 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