• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

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

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
msjodin
Asked:
msjodin
2 Solutions
 
b0lsc0ttCommented:
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
 
msjodinAuthor Commented:
This web is an intranet with a network connection.

dcomcnfg for MS access application has identity set to the interactive user.
0
 
royce2020Commented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
royce2020Commented:
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
 
msjodinAuthor Commented:
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
 
hclgroupCommented:
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now