![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| xp pro | msaccess.exe process not terminating The below code is what i have. it first opens an access database, runs a macro and emails the saved file to multiple recipients. Everything looks like it works the way it should, but i noticed that MSACCESS.EXE process is not ending. Any suggestions as to get the process to end after this script runs? This is running on Windows Server Standard 2003. $accessApp = new-object -com access.application $accessApp.Application.OpenCurrentDatabase("c:\powersource\masterupdate.mdb") $accessApp.Application.DoCmd.RunMacro("gr8eqlzero") $accessApp.Application.CloseCurrentDatabase() $filename = “C:\SCRIPTOUTPUT\GR8EQLZERO.CSV” $smtpServer = “mailserverhere” $msg = new-object Net.Mail.MailMessage $att = new-object Net.Mail.Attachment($filename) $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.From = “recipient@domain.com” $msg.To.Add(”recipient@domain.com”) $msg.Bcc.Add("bccrecipient@domain.net") $msg.Subject = “INVENTORY” $msg.Body = “INVENTORY file is attached” $msg.Attachments.Add($att) $smtp.Send($msg) |
My System Specs![]() |
| | #2 (permalink) |
| | Re: msaccess.exe process not terminating Immortal_creations wrote: Quote: > The below code is what i have. it first opens an access database, runs > a macro and emails the saved file to multiple recipients. Everything > looks like it works the way it should, but i noticed that MSACCESS.EXE > process is not ending. Any suggestions as to get the process to end > after this script runs? This is running on Windows Server Standard > 2003. $accessapp.quit() That works for me. -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #3 (permalink) |
| xp pro | Re: msaccess.exe process not terminating Marco lol I tried that. just forgot the () at the end.. geesh. still have a lot of learning to do with this stuff. Thank you very much. |
My System Specs![]() |
| | #4 (permalink) |
| xp pro | Re: msaccess.exe process not terminating Marco, Does that save any updates that were done to the access database? if not, what do i add to it? |
My System Specs![]() |
| | #5 (permalink) |
| | Re: msaccess.exe process not terminating Immortal_creations wrote: Quote: > Marco, > Does that save any updates that were done to the access database? > if not, what do i add to it? > > acQuitPrompt 0 Displays a dialog box that asks whether you want to save any database objects that have been changed but not saved. acQuitSaveAll 1 (Default) Saves all objects without displaying a dialog box. acQuitSaveNone 2 Quits Microsoft Access without saving any objects. These are options you can pass to quit(). I'm not 100% sure how, but it appears, that for Access 2007 at least, that just doing quit() will save the database. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Launch and Open a file in Msaccess thru cmd | Microsoft Office | |||
| problems with MSACCESS 2003 | Vista General | |||
| Opening an MSAccess DB | .NET General | |||
| run msaccess macro from PS | PowerShell | |||
| Wooly concepts? Terminating and non-terminating errors. | PowerShell | |||