By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,516 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

Rum time error - Command rejected

P: n/a
Hello all,
I have a table which has 30 memofields each containing a text. (Approx. 1/2
page). Depending on various situations these texts are sent via e-mail.
When the time comes to send text nr 24 it won't send and Visual Basic gives
me this warning :
Runtime error '6' 554 5.7.1. Command rejected. When clicking on help it
says something about overflow. However I thought that a memo field can
contain up to 65.000 charachters ?
Whats' more, when I erase 3 quarters of the text in this field, it WILL
send. So, in my opinion it must have something to do with overflow ... but
.... where ? I will add the snippet of the send function followed by the
snippet of the sending routine. By the way, in the Select case - Case "N" it
sends it all right, but when Case "E" (for English) it gives me the error,
even though the fields where the routine gets his data from now contain the
same text (for testing)
Any help very much appreciated !!!!

Here are the snippets:
'SEND FUNCTION :

Public Function SendEmail(Email As String, bcc As String, Subject As String,
body As String)

Dim Mail As MailSender
Set Mail = New MailSender
Mail.Host = "relay.skynet.be"
Mail.From = "my*****@myprovider.be"
Mail.AddAddress (Email)
Mail.Subject = Subject
Mail.body = sBody
Mail.AddBcc (bcc)
'Mail.AddAttachment (attach)

Mail.Send

End Function

'MAIL ROUTINE:

If rst!IsToBeVipPurs6 = True Then
If Date >= rst!DateSentVipPurs5 + DaysPersuade6AfterPersuade5 Then
If IsNull(rst!DateSentVipPurs6) Then
Select Case Nz(Trim(rst!Taal))
Case "N"
sFINALBODY = DLookup("[PERSUADE6NL]",
"tblMailTeksten")
If Nz(Trim(rst!Voornaam)) <> "" Then
sLastButAll =
Right(Trim(DLookup("[PERSUADE6NL]", "tblMailTeksten")), 1)
sStringLenght =
Len(Trim(DLookup("[PERSUADE6NL]", "tblMailTeksten")))
sAllButLast = Left(Trim(DLookup("[PERSUADE6NL]",
"tblMailTeksten")), sStringLenght - 1)
sFINALBODY = sAllButLast & " " & sVoornaam &
sLastButAll
End If
sBody = sAanspreking & vbCrLf & vbCrLf & sFINALBODY
& _
vbCrLf & vbCrLf & sGroetNL & vbCrLf & vbCrLf & _
sMyName & vbCrLf & sMyFunction & vbCrLf & sMyClub &
_
vbCrLf & sMyEmail
Subject = DLookup("[SUBJPERSUADE6NL]",
"tblMailTeksten")
If Nz(Trim(DLookup("[PERSUADE6NL]",
"tblMailTeksten"))) <> "" Then
lGoon = True
x = SendEmail(sVreemdeEmail, sBcc, Subject,
sBody)
End If
Case "E"
sFINALBODY = DLookup("[PERSUADE6EN]",
"tblMailTeksten")
If Nz(Trim(rst!Voornaam)) <> "" Then
sLastButAll =
Right(Trim(DLookup("[PERSUADE6EN]", "tblMailTeksten")), 1)
sStringLenght =
Len(Trim(DLookup("[PERSUADE6EN]", "tblMailTeksten")))
sAllButLast = Left(Trim(DLookup("[PERSUADE6EN]",
"tblMailTeksten")), sStringLenght - 1)
sFINALBODY = sAllButLast & " " & sVoornaam &
sLastButAll
End If
sBody = sAanspreking & vbCrLf & vbCrLf & sFINALBODY
& _
vbCrLf & vbCrLf & sGroetEN & vbCrLf & vbCrLf & _
sMyName & vbCrLf & sMyFunction & vbCrLf & sMyClub &
_
vbCrLf & sMyEmail
Subject = DLookup("[SUBJPERSUADE6EN]",
"tblMailTeksten")
Debug.Print sBody
If Nz(Trim(DLookup("[PERSUADE6EN]",
"tblMailTeksten"))) <> "" Then
lGoon = True
x = SendEmail(sVreemdeEmail, sBcc, Subject,
sBody)
End If
Case "NE"
sFINALBODY = DLookup("[PERSUADE6NL]",
"tblMailTeksten")
If Nz(Trim(rst!Voornaam)) <> "" Then
sLastButAll =
Right(Trim(DLookup("[PERSUADE6NL]", "tblMailTeksten")), 1)
sStringLenght =
Len(Trim(DLookup("[PERSUADE6NL]", "tblMailTeksten")))
sAllButLast = Left(Trim(DLookup("[PERSUADE6NL]",
"tblMailTeksten")), sStringLenght - 1)
sFINALBODY = sAllButLast & " " & sVoornaam &
sLastButAll
End If
sBody = sScrolldown & _
vbCrLf & vbCrLf
If IsNull(rst!Voornaam) Then
sAanhefNE = "Hallo," & vbCrLf & vbCrLf
Else
sAanhefNE = "Hallo " & Trim(rst!Voornaam) & "," &
vbCrLf & vbCrLf
End If
sBody = sBody & sAanhefNE & _
sFINALBODY & _
vbCrLf & vbCrLf & sGroetNL & vbCrLf & vbCrLf & _
sMyName & vbCrLf & sMyFunction & vbCrLf & sMyClub & _
vbCrLf & sMyEmail & vbCrLf & vbCrLf & vbCrLf
sFINALBODY = DLookup("[PERSUADE6EN]", "tblMailTeksten")
If Nz(Trim(rst!Voornaam)) <> "" Then
sLastButAll =
Right(Trim(DLookup("[PERSUADE6EN]", "tblMailTeksten")), 1)
sStringLenght =
Len(Trim(DLookup("[PERSUADE6EN]", "tblMailTeksten")))
sAllButLast = Left(Trim(DLookup("[PERSUADE6EN]",
"tblMailTeksten")), sStringLenght - 1)
sFINALBODY = sAllButLast & " " & sVoornaam &
sLastButAll
End If
If IsNull(rst!Voornaam) Then
sAanhefNE = "Hello," & vbCrLf & vbCrLf
Else
sAanhefNE = "Hello " & Trim(rst!Voornaam) & "," &
vbCrLf & vbCrLf
End If
sBody = sBody & sAanhefNE & _
sFINALBODY & _
vbCrLf & vbCrLf & sGroetEN & vbCrLf & vbCrLf & _
sMyName & vbCrLf & sMyFunction & vbCrLf & sMyClub & _
vbCrLf & sMyEmail
Subject = DLookup("[SUBJPERSUADE6NL]", "tblMailTeksten")
& _
" - " & DLookup("[SUBJPERSUADE6EN]", "tblMailTeksten")
If Nz(Trim(DLookup("[PERSUADE6NL]", "tblMailTeksten")))
<> "" _
And Nz(Trim(DLookup("[PERSUADE6EN]", "tblMailTeksten")))
<> "" Then
lGoon = True
x = SendEmail(sVreemdeEmail, sBcc, Subject, sBody)
Else
MsgBox ("En van de twee talen (Nederlands of
Engels) is leeg" & _
"Contact: " & sVreemdeEmail & " -- " &
Nz(Trim(rst!Voornaam)) & _
" " & Nz(Trim(rst!Naam)) & _
vbCrLf & "Uw tweetalige mail werd niet verstuurd!")
End If
End Select
rst.Edit
rst!DateSentVipPurs6 = Date

rst!IsToBeVipPurs6 = False
rst!IsToBeVipPurs7 = True
rst.Update
If lGoon = True Then
nHoeveelMails = nHoeveelMails + 1
End If
End If
End If
End If
lGoon = False
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ronny:

It says "something to do with overflow"?

You're more likely to get help if you provide the *exact* error
message.

Also: have you identified the exact line of code on which it's
frying? Providing that would also increase your chances of getting a
useful response.

Good luck! Hope to hear back from you!

-Matt
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.