Hello mighty gurus of the internet,
We have a table that stores data about emails. One of the columns is an NVarChar(max) called "Body" that stores the body of the email.
We have an access front end that's written in VBA, which uses ADO to communicate with the database.
The SQL Server back end has a stored procedure called "Add_Email_To_Request" which has the following definition:
CREATE PROCEDURE [dbo].[Add_Email_To_Request] @Req_ID int, @Sender_Name NVarChar(255), @Sender_EmAddress NVarChar(255), @Rcpt_Datetime DateTime, @Subject NVarChar(255), @Body NVarChar(max) = Null AS BEGIN SET NOCOUNT ON; INSERT INTO Cust_Emails ( Req_ID, Sender_Name, Sender_EmAddress, Rcpt_DateTime, Subject_Line, Body ) VALUES ( @Req_ID, @Sender_Name, @Sender_EmAddress, @Rcpt_Datetime, @Subject, @Body ) END GO
From the front end, we wish to execute the procedure using an ADO command object, but--when we try--we get an error saying "Parameter object is improperly defined. Inconsistent or incomplete information was provided."
If we modify the definition of the stored procedure to NVarChar(4000) and use Left(body,4000) in the front end to truncate the string the program executes seamlessly, but we'd like to store the entire email if possible.
Here are some system/environment details:
SQL Server Management Studio 15.0.18098.0
Microsoft Analysis Services Client Tools15.0.1300.89
Microsoft Data Access Components (MDAC)10.0.14393.0
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.14393.0
Microsoft .NET Framework4.0.30319.42000
Operating System6.3.14393
Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) Aug 22 2017 17:04:49 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 14393: )
What could be causing this frustrating problem?
Million thanks,
Daniel Gesua