CDO message delete

G

Guest

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
 
G

Guest

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)
 
P

Peter Huang [MSFT]

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.
 
P

Peter Huang [MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top