IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationIIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 26th, 2004, 11:21 PM
sushantji sushantji is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 5 sushantji User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
MSP Project Instance not getting closed

We are working on a web based application with IIS 5.0 as web server. There is a feature in our application where we need to integrate with Microsoft Project 2000 Service Release 1. We upload the contents of MPP file into our database at run-time from the path specified by the user.

To achieve this, we have created a VB COM component which uses Microsoft Project 9.0 Object libray. The ASP page then uses this VB COM dll to do the desired task. All this works fine on Windows XP. But on Windows 2000 Server (which is our deployment server), when the first time we access this ASP page to upload contents of MPP file to our database, things work fine. But second time onwards it does not work. Infact, IIS gets hanged and only option is to restart the server machines. The reason is that during the first access, the "winproj.exe" process does not get terminated. When we try to manually end this process from Task Manger, it does not allow, says "Access Denied". We also tried to kill this particuar process using "Kill.exe". But even Kill.exe is unable to kill this process.

Also, the same code works fine on Win 2000 when we RUN it from VB or by making an EXE file. The MS Project instance (winproj.exe) gets closed with "prjApp.Quit". But when we make it as a DLL and call from asp page, it doesnt.

Given below is the function that is written in the VB com to do the task (pls note that this code copies the contents of MPP file to an EXCEL file & then we read from the excel file to upload data into our database):

Function MPP2XL(filename As String)

On Error GoTo Err_Block

Dim projfile As String
' other variables
'..................................
'..................................
'..................................

Dim prjApp As New MSProject.Application
Dim prjProject As MSProject.Project

Dim xlapp As New Excel.Application
Dim oBook As New Excel.Workbook
Dim oWksht As Excel.Worksheet

projfile = filename
prjApp.FileOpen projfile & ".mpp"
Set prjProject = prjApp.ActiveProject

m_tasks = prjProject.Tasks.Count

Set oBook = xlapp.Workbooks.Open(templet)
Set oWksht = oBook.Worksheets.Item("Project_MilestoneTask")

'copying from MPP fle to EXcel file and saving the Excel file ------ this works fine.
'...................................
'..................................
'..................................
'..................................

Err_Block:

Dim strMPP As String: strMPP = ""

If Not oWksht Is Nothing Then Set oWksht = Nothing

If Not oBook Is Nothing Then
oBook.Close (False)
Set oBook = Nothing
End If

If Not xlapp Is Nothing Then
xlapp.Quit
Set xlapp = Nothing
End If

If Not prjApp Is Nothing Then

prjApp.FileClose pjDoNotSave
prjApp.ActiveProject = Nothing
prjApp.Quit
Set prjProject = Nothing
Set prjApp = Nothing

End If

End Function


The problem is the code "prjApp.Quit" does not make the MS Project application quit in Win 2000 when the DLL is called from my ASP page.

Also, the winproj.exe process could be killed from XP using the Task Manager but not in 2000 (could be a security feature???)

Thanks
Sushant

Reply With Quote
  #2  
Old February 27th, 2004, 03:12 PM
Doug G Doug G is online now
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,713 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 58 m 55 sec
Reputation Power: 688
I have no idea on this one, sorry.
__________________
======
Doug G
======
"Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton

Reply With Quote
  #3  
Old March 9th, 2004, 04:13 AM
sushantji sushantji is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 5 sushantji User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried the same code on Windows 2003 Server. There it worked fine. Could it be because of difference between security settings of these servers?

Reply With Quote
  #4  
Old March 9th, 2004, 04:26 PM
Doug G Doug G is online now
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,713 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 58 m 55 sec
Reputation Power: 688
I think that's likely. Permissions are at the bottom of many, many strange problems

Reply With Quote
  #5  
Old April 20th, 2004, 10:26 AM
bandit_br bandit_br is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 bandit_br User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
same problem

Sushant Ji,
you had already the solution of this problem?
I'm with the same error


Rafa

Last edited by bandit_br : May 20th, 2004 at 08:51 AM.

Reply With Quote
  #6  
Old September 8th, 2004, 06:26 PM
arkay1106 arkay1106 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 arkay1106 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
MSP Project Instance not getting closed

Quote:
Originally Posted by sushantji
I tried the same code on Windows 2003 Server. There it worked fine. Could it be because of difference between security settings of these servers?



Hello Sushanth,
I am getting same problem on windows 2000 server with IIS 5.0. Is this problem is resolved on window 2000 server or did you find any other alternate.

Reply With Quote
  #7  
Old November 16th, 2004, 04:40 AM
abhishek1234567 abhishek1234567 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 abhishek1234567 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Shushant ji

can you provide me full source code of vb com component
that read a mpp file .
thank you

Reply With Quote
  #8  
Old November 17th, 2004, 12:39 AM
sushantji sushantji is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 5 sushantji User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb Workaround

I came up with a workaround for this problem. Instead of opening and closing an MS Project instance every time a request comes, I am using a single global instance stored in an application variable. I initialize this instance in global.asa file when application starts. Each request uses this very instance to upload data.

Since MS Project can have atmost one instance at anytime, I am also using a global flag (also initialized in global.asa) to check if one upload is already in progress.

Downside of this workaround is that the process always remains in the memory but a huge upside is that it has saved us from buying a licence for a new Windows 2003 Server

Hope this helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationIIS > MSP Project Instance not getting closed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway