?
Solved

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

Posted on 2006-10-25
6
Medium Priority
?
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1600 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
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!

 
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 400 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

Industry Leaders: 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!

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

650 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