homepage Welcome to WebmasterWorld Guest from 54.234.225.23
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
Error: Microsoft Access can't open the database
VBscript in Data Access Pages
kikowillers




msg:335290
 5:58 pm on Dec 6, 2004 (gmt 0)

Hi! I just started to work with data acces pages and I need some help.

I have a database(mdb) in a web server and the users will access it by internet(IE) using data access pages. I have no problems to access data, add, edit or delete. The probem happens when I try to use a button to print a report. I've been getting this error message, no matter what I try: Microsoft Access can't open the database because it is missing, or opened exclusively by another user.

The code I'm using is:

-------------------------------------
<SCRIPT language=vbscript event=onclick for=ButtonPrintEnvelope>
<!--

Dim objAcc
Dim strcodecustomer

strcodecustomer = MSODSC.DataPages(0).Recordset.Fields("ID")

Set objAcc = CreateObject("Access.Application")
objAcc.OpenCurrentDatabase "C:\Database\Test.mdb"
objAcc.DoCmd.OpenReport "Envelope", , , "id = " & strcodecustomer

-->
</SCRIPT>
-------------------------------------
Does anybody know what I'm doing wrong? Maybe it is the way I'm expressing the path of the database, but I've tried everything I know.

PLEASE HELP!

Thanks in advance,

Kiko

 

trillianjedi




msg:335291
 5:52 pm on Dec 8, 2004 (gmt 0)

<cough>

Anyone? I would have thought we'd have an Access expert among us somewhere...?

TJ

Corey Bryant




msg:335292
 6:28 pm on Dec 8, 2004 (gmt 0)

This is why I have my developers, but you might have a quicker response in the Microsoft Related - .NET and ASP forum: [webmasterworld.com...]

-Corey

mattur




msg:335293
 6:32 pm on Dec 8, 2004 (gmt 0)

Not used Data Access Pages, but I have seen this error message in asp pages when the database and/or Access is still open on the local workstation.

Do you still get the problem when you've come right out of Access?

kikowillers




msg:335294
 1:21 pm on Dec 9, 2004 (gmt 0)

Hello!

I still didn't figure out what is going on. I'm sure the database is not open when I try to print the report.

I'm pretty sure that the problem is finding the database (path). We don't have physical access to the server (only remote access). Does anybody have an idea on how to do that?

Thanks in advance.

Kiko

mattur




msg:335295
 1:27 pm on Dec 9, 2004 (gmt 0)

You can check the remote server path with:

<%
Response.write(Server.MapPath("/"))
%>

lizardx




msg:335296
 11:48 pm on Jan 4, 2005 (gmt 0)

there's an access lock file that's in place but shouldn't be I think. Yet another reason not to use access for web based applications. Sometimes it's also a permissions problem, it's hard to say, depends on the hoster, some of them really restrict what you can do with access.

Access is great for secretaries keeping their mailing lists for mail merge, but it's a horrible product for working with on websites, the sooner you switch to a real db, the happier you'll be.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved