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

CDO message delete

P: n/a
I wrote a function to delete specific messages in an archive sync. It works
just find as long as the url (file name) does not include any illegal
characters. Is there a way to use cdoex to delete the messages as an
alternative or someway to replace the illegal characters? Below is the
function which takes a single parameter. Such as
(file://./storeage/domain/MBX/archive/Inbox/goodStuff.EML) and it delete the
email.
If the file name is such as (file://./storeage/domain/MBX/archive/Inbox/bad
stuff == % $ #@.EML) and fails to delete the email.


Private Sub DeleteMailRecord(ByVal sURL As String)

Dim Rec As New ADODB.Record
Dim Conn As New ADODB.Connection
Try
Conn.Provider = "ExOLEDB.DataSource"
Conn.Open(sURL)
Rec.Open(sURL, Conn, ADODB.ConnectModeEnum.adModeReadWrite)
Rec.DeleteRecord()

Catch ex As Exception

MessageStore += "ERROR-Delete: " & ex.Message & sURL
Finally
Conn.Close()
End Try


End Sub
--
Philip
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Philip

Have a look at the urlencode method

http://msdn.microsoft.com/library/de...ncodetopic.asp
I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
That didn't do it, I wonder if it has something to do with the ADO exoleDB
datasource and not supporting the escape characters. I get a message of
"Object, or data matching the name, range, or selection criteria was not
found within the scope of this operation." At the conn.open(URL)

"Cor Ligthert" wrote:
Philip

Have a look at the urlencode method

http://msdn.microsoft.com/library/de...ncodetopic.asp
I hope this helps,

Cor

Nov 21 '05 #3

P: n/a
Hi Philip,

So far I am researching the issue, and I will update you with new
information ASAP.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4

P: n/a
Hi

I think you may try to encode it as the url specification.

You may have a try and let me know the result.

For % you one should use %25 in eml url and for # %23.
For example test%subject will be test%25subject.eml and test#subject will
be test%23subject.eml
From:
http://www.everything2.com/index.pl?node_id=1350052

"
To use an escape code, simple convert the character's ASCII value to its
hexadecimal equivalent, and prefix it with a percent sign (%). Replace the
character with this new value (%xx) in the URL. Below are the commonly used
escape sequences:

Escape | Escape
Character Sequence | Character Sequence
-----------------------+-----------------------
Space %20 | ; %3B
& %26 | = %3D
< %3C | ? %3F
%3E | @ %40

" %22 | [ %5B
# %23 | \ %5C
$ %24 | ] %5D
% %25 | ^ %5E
' %27 | ` %60
+ %2B | { %7B
, %2C | | %7C
/ %2F | } %7D
: %3A | ~ %7E

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.