Here is my code, it still does not appear to be working. I am still
leaving an instance open every time I run this code.  What am I doing
wrong?



dim objAccess, objReport
objAccess = Server.CreateObject("Access.Application")
objAccess.OpenCurrentDatabase ("c:\inetpub\db\checkbook.mdb")
objAccess.doCmd.OpenReport("aggregate_report-account_order")
objAccess.doCmd.Close()
objAccess.CloseCurrentDatabase()
objAccess.Application.Quit()
objAccess = nothing

Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com
 

-----Original Message-----
From: David L. Penton [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 17, 2002 12:08 PM
To: dotnet
Subject: RE: ASP.NET and COM Objects

That is one of the hazards of Office Automation...

//where msa is the Access.Application object
msa.Application.Quit()
msa = Nothing

You may need to .Dispose of this ASAP to get it to shut off.


David L. Penton, Microsoft MVP
JCPenney Application Specialist / Lead
"Mathematics is music for the mind, and Music is Mathematics for the
Soul. - J.S. Bach"
[EMAIL PROTECTED]

Do you have the VBScript Docs or SQL BOL installed?  If not, why not?
VBScript Docs: http://www.davidpenton.com/vbscript
SQL BOL: http://www.davidpenton.com/sqlbol


-----Original Message-----
From: Matthew Small [mailto:[EMAIL PROTECTED]]

Actually, I have one problem.

I am now leaving an instance of Access open on my server each time I run
my application to print out my report.  How can I kill this process when
it's done?

Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com
 

-----Original Message-----
From: Matthew Small [mailto:[EMAIL PROTECTED]] 

Thanks for the response, I finally got someone to notice me.  :-)

Actually, I have solved the issue that I had.  I needed to open up an
access database to send a report to the local intranet printer when a
user clicks on a button in my intranet application.

It turns out that the user that ASP.NET runs under did not have enough
privileges to open up the Access file.  I changed the user in the
machine.config file to system and now it works fine.  I am in an
intranet setting where security is of very low concern so I am not
worried about the implications of doing that.


Thanks for your help.


Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com
 

-----Original Message-----
From: Kenneth Courville [mailto:[EMAIL PROTECTED]] 

Do you actually need to create an Access session? Or are you just trying
to
access the database?


-----Original Message-----
From: Matthew Small [mailto:[EMAIL PROTECTED]]

Hi,
        I'm not expert on COM.  I'm trying to open up Access through a
COM object to print a report to the local intranet, but I am having
security issues.  I've already done what the error message tells me to
do to remedy the situation, but it still doesn't work.  Any ideas?  Does
anybody read these posts?  I don't get any answers, but I will keep on
trying.


The error message:

Access is denied. 
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code. 

Exception Details: System.UnauthorizedAccessException: Access is denied.


The ASP.NET process is not authorized to access the requested resource.
For security reasons the default ASP.NET process identity is
'{machinename}\ASPNET', which has limited privileges. Consider granting
access rights to the resource to the ASP.NET process identity. 

To grant ASP.NET write access to a file, right-click the file in
Explorer, choose "Properties" and select the Security tab. Click "Add"
to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account,
and check the Write box in the Allow column.


Offending code:

objAccess = Server.CreateObject("Access.Application")


Thank you,

Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com


---
You are currently subscribed to dotnet as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/






---
You are currently subscribed to dotnet as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/


Reply via email to