473,800 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDO message delete

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 DeleteMailRecor d(ByVal sURL As String)

Dim Rec As New ADODB.Record
Dim Conn As New ADODB.Connectio n
Try
Conn.Provider = "ExOLEDB.DataSo urce"
Conn.Open(sURL)
Rec.Open(sURL, Conn, ADODB.ConnectMo deEnum.adModeRe adWrite)
Rec.DeleteRecor d()

Catch ex As Exception

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


End Sub
--
Philip
Nov 21 '05 #1
4 2889
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1938
by: Mark | last post by:
Not sure this is the right place for this questions, but here goes: I get an error message when deleting an table from a Access database. The code is as follows and the error message is after it. ***************** Start Code ******************** <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.Oledb" %>
4
2951
by: Mark | last post by:
Not sure this is the right place for this questions, but here goes: I get an error message when deleting an table from a Access database. The code is as follows and the error message is after it. ***************** Start Code ******************** <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.Oledb" %>
8
4068
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: DoCmd.SetWarnings False DoCmd.RunCommand acCmdDeleteRecord DoCmd.SetWarnings True End If ExitHere: Me!SubName.SetFocus
13
3802
by: N. Graves | last post by:
Thanks for take time to read my question!! I'm using code that will automatically delete rows of data in a field and of course when you do this Access will prompt you that you are about to delete x number of rows. Most of the time I want this message be displayed. Can I use code that will delete specified rows and not give the message? Here is the code that I'm currently using:
2
3761
by: Mike Moore | last post by:
asp.net app - How do you get Java-side code to communicate with server-side code? I have tried numerous ways and examples, but have been unsuccessful. Therefore, unless I get real lucky and find another way of doing a messagebox, none of the existing ways will work with the code we have already written. Most all of the message box examples that I have found had the message box code being executed behind a button, which triggers a...
3
1841
by: Greg Smith | last post by:
What is the best way to present a "Confirm Delete" message to a user and get the response back? Any help is greatly appreciated.
8
1978
by: DP | last post by:
hi, i've got a price of code, which checks to see if a film is on rent, or available. but how can i actualyl make the cancel button do somthing? because, the cursor gets stuck on the filmID field. this is wat i've got so far; Private Sub FilmID_BeforeUpdate(Cancel As Integer) If DCount("*", "tblFilmRental", "FilmID=" & Me!) > 0 Then Cancel = True
2
1540
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
I have a asp page. I have a form View. In EditTemplate I have a delete button. When I click on that delete button In OnClientclick it should give me message. Are you sure you want to delete this user? * This will change user status to delete. *But the user will be in the same System. OK Cancel
12
13440
by: jpatchak | last post by:
Hello all, I have an annoying message popping up every time I close a form. Due to performance issues, I am caching data from a linked table on a SQL Server into a temporary local table. The user makes changes to data that are stored in the local table. Then, when the user closes the form, I run a couple of quick queries to update the data back on the server and delete any data in the temp table. After the code runs in the Close event of...
2
1664
by: Vincent | last post by:
Hi, There are two related tables: one called 'group' and the other 'items'. Each item belongs to a group. The table 'group' is shown in a gridview with a linkbutton for deleting. When an user tries to delete a group which still contains items, he gets the message: "The DELETE statement conflicted with the REFERENCE constraint "FK_items_groep1". The conflict occurred in database "tennis", table
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.