Solved

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

Posted on 2006-10-25
6
233 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now