Link to home
Start Free TrialLog in
Avatar of mlcktmguy
mlcktmguyFlag for United States of America

asked on

Passing and nvarchar(Max) parameter form Access 2013 to a SQL Server SPROC?

I am writing a routine in my Access 2013 front end that calls a SPROC on SQL Server.  One of the params is a user comment that is defined as nvarchar(max) on the SQl side.

I have written access routines that call SPROCS, passing string variables but they are of a defined length.  A param statement passing to a field defined as nvarchar(30) in SQL looks like this:

    Set param6 = .CreateParameter("passedUserName", adVarChar, adParamInput, 30, passedUserName)
    .Parameters.Append param6

Open in new window


What would the syntax be when passing a param defined a nvarchar(max) in the SPROC?

I'm temporarily using
    Set param6 = .CreateParameter("passedUserName", adVarChar, adParamInput, 1000 , passedUserName)
    .Parameters.Append param6

Open in new window

but that has a fixed length of 1000.
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

Pass it as if it was the old nText datatype in SQL (a guess) Access 2013 doesn't understand or recognise the varchar(max) datatype.

Kelvin
ASKER CERTIFIED SOLUTION
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial