HELP: Server.CreateObject("Access.Application") ERROR

HELP: Server.CreateObject("Access.Application") ERROR

am 02.09.2005 13:00:09 von WolfWoman

Hi,
This is an ongoing problem which I simply cannot fix.
I have an ASP application which uses Access Reporting to create
invoices. In order to run the report, I make use of
Server.CreateObject("Access.Application").
This works fine when running the client and server on the same
Windows XP computer.
I have uploaded it to my hosting site, run it from here and the I get
an error on executing the line
Server.CreateObject("Access.Application").

I have done lots of research on this and gather it is something to do
with Access Permissions and user accounts. Is that correct? Is there
any workaround?

I have also tried running this application on a local network, again
using a separate server to run IIS and connecting from a client via a
network. I get the same error. However I am at liberty to change Access
Database permissions locally. Question is what combination of changes
are the correct one?? I have tried all sorts of username, folder
permissions, etc etc and have got nowhere.

PLEASE HELP if you can. I would really be very very grateful.

Here is an extract of code:


Lynn

Dim objAccess 'This is our MSAccess object
dim MyFileLocation

'----------------------------------------------------------- ------
'Now we get the data we need from the submitted Form
'----------------------------------------------------------- ------
strDbName = strPath
MyReportDesc = Request.QueryString("ReportDesc")
strRptName = Request.QueryString("ReportID")
strWhere = "invoice_id=" & Request.QueryString("Invoice_Id")
strFilter = ""

strSnapFile = "Invoice" & Request.QueryString("Order_Id")& ".snp"

MyFileVirt = "Invoices" & Request.QueryString("InvoiceType")& "/" &
"Invoice" & Request.QueryString("Invoice_Id") & ".snp"
Err.Clear
'----------------------------------------------------------- ------
' Create an instance of access. Visible is set to false b/c
' this is running as a proccess, not as a desktop application
'----------------------------------------------------------- ------
if err <> 0 then
Response.Write "Errors before creating application"
End If
Set objAccess = Server.CreateObject("Access.Application")
objAccess.Visible = False
if err <> 0 then
Response.Write "Errors before opening database 1"
End If
'----------------------------------------------------------- ------
' Open the database, then the Report, and output it in Snapshot format
'----------------------------------------------------------- ------
objAccess.OpenCurrentDatabase strDbName
if err <> 0 then
Response.Write "Errors on opening database 2"
End If
'With objAccess.DoCmd
' open in preview mode so that we can pass a where clause
' if neccesary
objAccess.DoCmd.OpenReport "Inv" & Request.QueryString("InvoiceType"),
acViewPreview, strFilter, strWhere
if err <> 0 then
Response.Write "Errors on OpenReport"
Response.Write "1:" &strRptName & "
"
Response.Write "2:" & acViewPreview & "
"
Response.end
End If

Re: Server.CreateObject("Access.Application") ERROR

am 02.09.2005 13:21:12 von reb01501

WolfWoman wrote:
> Hi,
> This is an ongoing problem which I simply cannot fix.
> I have an ASP application which uses Access Reporting to create
> invoices. In order to run the report, I make use of
> Server.CreateObject("Access.Application").
> This works fine when running the client and server on the same
> Windows XP computer.
> I have uploaded it to my hosting site, run it from here and the I get
> an error on executing the line
> Server.CreateObject("Access.Application").
>
> I have done lots of research on this and gather it is something to do
> with Access Permissions and user accounts. Is that correct?

Not really, unless you are using a database secured with workgroup security
(not advised).

>
> I have also tried running this application on a local network, again
> using a separate server to run IIS and connecting from a client via a
> network. I get the same error. However I am at liberty to change
> Access Database permissions locally. Question is what combination of
> changes are the correct one?? I have tried all sorts of username,
> folder permissions, etc etc and have got nowhere.

This may help:
http://support.microsoft.com/default.aspx?scid=kb;en-us;2577 57

Don't forget: Access needs to be installed on the machine on which the code
attempting to use Access.Application is running ...

In the long run, you may wish to rethink your decision to try and use Access
to provide your reports on the web. It's not really intended for that. See:
http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls =GGLC,GGLC:1969-53,GGLC:en&q=ASP+Access+snapshot

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: HELP: Server.CreateObject("Access.Application") ERROR

am 08.09.2005 04:03:26 von Bullschmidt

And this is something I put together about ASP that hopefully might help
somehow. And the only part of the Access database even used on the Web
is the tables (and possibly some queries).

Web Database Concept
http://www.bullschmidt.com/concept.asp

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***

Re: HELP: Server.CreateObject("Access.Application") ERROR

am 08.09.2005 04:05:40 von Bullschmidt

That sounds like client-side VBScript that wouldn't work on non MS
browsers and as previously mentioned wouldn't work on a PC that didn't
have Access installed and apparently the database on the PC (or on the
network).

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Developersdex http://www.developersdex.com ***