Solved

Size defined in Excel VBA

Posted on 2015-01-22
1
71 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use odbc in vb to connect to ms sql 14 53
Replace Dates in query 14 40
Alter a column in sql 34 30
Query Syntax 17 36
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

778 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