Solved

Why does Access DB accessed via ASP comes up on server instead of client?

Posted on 2006-10-25
6
259 Views
Last Modified: 2010-04-16
Why does Access DB accessed via ASP comes up on server instead of client?

I have code:
Dim objAcc
Set objAcc=Server.CreateObject("Access.Application")
objAcc.Visible = true
objAcc.OpenCurrentDatabase "\\dev2\KeetacAccess\Lab2000.mdb"
objAcc.DoCmd.OpenForm "AdjustmentsFrm"

The form comes up alrifht but it comes up on the server.  I would like the db to come up on the client. What am I doing wrong?

Thank you.
0
Comment
Question by:msjodin
6 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17806655
msjodin,

Is this an intranet or over the Internet?  ASP is a server side app so the server would need to be able to access the client computer.  The browser would not allow this so it would have to be over a network connection.  If the server can access that client machine then what is the physical path?

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 1

Author Comment

by:msjodin
ID: 17806725
This web is an intranet with a network connection.

dcomcnfg for MS access application has identity set to the interactive user.
0
 
LVL 3

Accepted Solution

by:
royce2020 earned 400 total points
ID: 17808896
The trick here is to put the code in VB script inside a <script> tag if you want it to be run (and visable) on the client side. If you have it in your ASP code it will open on the server. For example, this will open on the server:

<%
Dim objAcc
Set objAcc=Server.CreateObject("Access.Application")
objAcc.Visible = true
objAcc.OpenCurrentDatabase "\\dev2\KeetacAccess\Lab2000.mdb"
objAcc.DoCmd.OpenForm "AdjustmentsFrm"
'More ASP here
%>
<HTML><Body></Body></HTML>

and this will open on the client:

<%
'more ASP here
%>
<HTML>
<head></head>
<SCRIPT Language="VBScript">
Set objAcc = CreateObject("Access.Application")
objAcc.Visible = true
objAcc.OpenCurrentDatabase "\\dev2\KeetacAccess\Lab2000.mdb"
objAcc.DoCmd.OpenForm "AdjustmentsFrm"
</script>
<body></body>
</HTML>
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 3

Expert Comment

by:royce2020
ID: 17808906
I've just realised that the client in this case would probibly need to be running IE and have a fairly low security setting.
0
 
LVL 1

Author Comment

by:msjodin
ID: 17811436
In the following code I get an Error: Object required: 'Server'

Is there a way to create Server.CreateObject("Access.Application") on the client or pass it from the server to the client?  WHen I set runat=server of course the Access form comes up on the server as when between <%  %>

<script language="VBScript">

set objAcc=Server.CreateObject("Access.Application")
objAcc.Visible = true
objAcc.OpenCurrentDatabase "\\dev2\KeetacAccess\Lab2000.mdb"
objAcc.DoCmd.OpenForm "AdjustmentsFrm"


'objAcc.Quit 'acQuitSaveNone
'set objAcc = Nothing
</script>
0
 
LVL 4

Assisted Solution

by:hclgroup
hclgroup earned 100 total points
ID: 17811976
Why are you using

set objAcc=Server.CreateObject("Access.Application")

As royce2020 said all you need is

Set objAcc = CreateObject("Access.Application")
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question