Click here to Skip to main content
15,916,180 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: problem with visual studio .net and the oledb namespace Pin
Dave Kreskowiak12-Jan-05 1:01
mveDave Kreskowiak12-Jan-05 1:01 
GeneralRe: problem with visual studio .net and the oledb namespace Pin
Anonymous12-Jan-05 4:21
Anonymous12-Jan-05 4:21 
GeneralRe: problem with visual studio .net and the oledb namespace Pin
Dave Kreskowiak12-Jan-05 11:58
mveDave Kreskowiak12-Jan-05 11:58 
GeneralFile Delete problem in Windows Service Pin
P Holroyd11-Jan-05 11:02
P Holroyd11-Jan-05 11:02 
GeneralRe: File Delete problem in Windows Service Pin
Dave Kreskowiak11-Jan-05 15:47
mveDave Kreskowiak11-Jan-05 15:47 
GeneralRe: File Delete problem in Windows Service Pin
P Holroyd11-Jan-05 21:01
P Holroyd11-Jan-05 21:01 
GeneralRe: File Delete problem in Windows Service Pin
Dave Kreskowiak12-Jan-05 0:58
mveDave Kreskowiak12-Jan-05 0:58 
GeneralRe: File Delete problem in Windows Service Pin
Anonymous12-Jan-05 1:37
Anonymous12-Jan-05 1:37 
Ok so it gets stranger and stranger, I deployed the program on a Win2000 server and it started working ok. The files come in get logged and then deleted ok.

I'm thinking you might be right because a local system service on a server will have greater access rights?

Here's a copy of the code :-
<br />
Private Sub ReadWrite()<br />
        Try<br />
<br />
            Dim iDropDir As New CDO.DropDirectory<br />
            Dim pMsgs As CDO.IMessages<br />
            Dim pAttachments As CDO.IBodyParts<br />
            Dim i As Integer<br />
<br />
            pMsgs = iDropDir.GetMessages(Directory.GetDirectoryRoot _     (AppSettings("Drop Dir")) & AppSettings("Drop Dir"))<br />
<br />
            For i = 1 To pMsgs.Count<br />
                pAttachments = pMsgs(i).Attachments()<br />
                If LogUpdateMsg(pMsgs(i), 2, pAttachments) <> False Then _<br />
                Kill(iDropDir.GetMessages.FileName(pMsgs(i)))<br />
               Next<br />
            <br />
        Catch ex As Exception<br />
              ExceptionManager.Publish(ex)<br />
        End Try<br />
    End Sub<br />


I'm picking up the Emails/Attachments here and calling a stored procedure in 'LogUpdateMessage' to log them, if the log is ok I kill the file.

On my test machine the program loops once, logs the message ok but doesn't delete the message from the drop directory. When the loop executes again the messages are picked up again and I get the following exception when I try to read the attachments :-


General Information <br />
*********************************************<br />
Additional Info:<br />
ExceptionManager.MachineName: STU<br />
ExceptionManager.TimeStamp: 12/01/2005 12:43:54<br />
ExceptionManager.FullName: Microsoft.ApplicationBlocks.ExceptionManagement, Version=1.0.1795.22054, Culture=neutral, PublicKeyToken=null<br />
ExceptionManager.AppDomainName: smsservice.exe<br />
ExceptionManager.ThreadIdentity: <br />
ExceptionManager.WindowsIdentity: NT AUTHORITY\SYSTEM<br />
<br />
1) Exception Information<br />
*********************************************<br />
Exception Type: System.UnauthorizedAccessException<br />
Message: Access is denied.<br />
<br />
TargetSite: CDO.IBodyParts get_Attachments()<br />
HelpLink: NULL<br />
Source: CDO.Message.1<br />
<br />
StackTrace Information<br />
*********************************************<br />
   at CDO.MessageClass.get_Attachments()<br />
   at SMSService.Service1.ReadWrite()


But like I say the same code running on the server is ok and this exception never gets raised.
GeneralRe: File Delete problem in Windows Service Pin
P Holroyd12-Jan-05 1:46
P Holroyd12-Jan-05 1:46 
GeneralRe: File Delete problem in Windows Service Pin
Dave Kreskowiak12-Jan-05 11:51
mveDave Kreskowiak12-Jan-05 11:51 
GeneralRe: File Delete problem in Windows Service Pin
P Holroyd13-Jan-05 7:17
P Holroyd13-Jan-05 7:17 
GeneralRe: File Delete problem in Windows Service Pin
P Holroyd17-Jan-05 23:35
P Holroyd17-Jan-05 23:35 
GeneralSerial com port communication! Pin
Member 162670711-Jan-05 10:38
Member 162670711-Jan-05 10:38 
GeneralRe: Serial com port communication! Pin
Ritesh123411-Jan-05 21:21
Ritesh123411-Jan-05 21:21 
GeneralExcel Automation VB.Net (SQL Server) Question Pin
JZion11-Jan-05 5:57
JZion11-Jan-05 5:57 
Generalcopy &amp; paste in VB6 Pin
Britnt711-Jan-05 4:32
Britnt711-Jan-05 4:32 
QuestionHow to integrate reporting service with vb.net Pin
Mekong River11-Jan-05 4:29
Mekong River11-Jan-05 4:29 
AnswerRe: How to integrate reporting service with vb.net Pin
Member 56585711-Jan-05 6:41
Member 56585711-Jan-05 6:41 
GeneralEasy Questions for CPians Pin
Sebastien Lachance11-Jan-05 4:17
Sebastien Lachance11-Jan-05 4:17 
GeneralRe: Easy Questions for CPians Pin
Dave Kreskowiak11-Jan-05 6:09
mveDave Kreskowiak11-Jan-05 6:09 
GeneralRe: Easy Questions for CPians Pin
Sebastien Lachance11-Jan-05 6:38
Sebastien Lachance11-Jan-05 6:38 
GeneralRe: Easy Questions for CPians Pin
Dave Kreskowiak11-Jan-05 9:18
mveDave Kreskowiak11-Jan-05 9:18 
GeneralRe: Easy Questions for CPians Pin
Sebastien Lachance12-Jan-05 2:34
Sebastien Lachance12-Jan-05 2:34 
GeneralRe: Easy Questions for CPians Pin
Dave Kreskowiak12-Jan-05 8:13
mveDave Kreskowiak12-Jan-05 8:13 
GeneralRe: Easy Questions for CPians Pin
Sebastien Lachance12-Jan-05 8:43
Sebastien Lachance12-Jan-05 8:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.