运行时错误'2147217887(80040e21)字符串数据,右截断 [英] Run Time Error '2147217887 (80040e21) String data, Right Truncation
问题描述
        我的宏(outlook)有问题。我在回复电子邮件时会返回错误。
       请参阅下面的代码块。
       请帮帮我。
问候,
Jerzon
Sub ProcessWsubject(ByRef pMailItem As Outlook.MailItem)
Dim vSQL As New ADODB.Connection
Dim vCMD As New ADODB.Command
Dim vSenderAddress As String
vSenderAddress = GetSenderEmail( pMailItem.SenderEmailAddress)
'打开到SQL Server的连接
vSQL.Open(mSQLConStr)
使用vCMD
.ActiveConnection = vSQL
.CommandType = adCmdStoredProc
.CommandText =" spEmailWRSub"
.CommandTimeout = 0
.Parameters(" @ UIDL")。Value = pMailItem.EntryID
.Parameters(" @ DateSend")。Value = pMailItem.SentOn
.Parameters(" @ SenderEmail")。Value = vSenderAddress
.Parameters(" @ Recipient")。Value =" JOBarbacena@neltex.com"
.Parameters(" @vSubject")。Value = pMailItem.Subject
.Parameters(" @ EmailBody")。Value = pMailItem.Body
.Parameters(" @ Remarks" ).Value =""
.Execute ---调试后指向此错误
结束
vSQL.Close
End Sub
嗨Jerzon Barbacena,
感谢您的提问。
根据您的错误消息, 一种可能性是该问题可能与数据有关
长度/类型 。 请检查参数的定义和数据的长度。
< p style ="margin:0in; font-family:Calibri; font-size:11.0pt">您能否分享更多信息,例如您的存储过程或您的价值观?
有类似的帖子,请参考它。
希望它可以帮到你。
最好的问候,
拉结
Hi,
I have a problem with my macro(outlook). It return an error when I'm replying an email.
Kindly refer to the code block below.
Please help me.
Regards,
Jerzon
Sub ProcessWsubject(ByRef pMailItem As Outlook.MailItem) Dim vSQL As New ADODB.Connection Dim vCMD As New ADODB.Command Dim vSenderAddress As String vSenderAddress = GetSenderEmail(pMailItem.SenderEmailAddress) ' Open connection to SQL Server vSQL.Open (mSQLConStr) With vCMD .ActiveConnection = vSQL .CommandType = adCmdStoredProc .CommandText = "spEmailWRSub" .CommandTimeout = 0 .Parameters("@UIDL").Value = pMailItem.EntryID .Parameters("@DateSend").Value = pMailItem.SentOn .Parameters("@SenderEmail").Value = vSenderAddress .Parameters("@Recipient").Value = "JOBarbacena@neltex.com" .Parameters("@vSubject").Value = pMailItem.Subject .Parameters("@EmailBody").Value = pMailItem.Body .Parameters("@Remarks").Value = "" .Execute --- the error pointing this after debug End With vSQL.Close End Sub
Hi Jerzon Barbacena,
Thank you for your question .
Per your error message ,one possibility is that the issue may be related to the data length /type . Please check the definition of parameters and the length of your data.
Could you please share us more information, for example your stored procedure or you values ?
There is an similar posting , please refer to it .
String data, right truncation error
Hope it can help you.
Best Regards,
Rachel
这篇关于运行时错误'2147217887(80040e21)字符串数据,右截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!