Solved

Microsoft JET Database Engine error '80040e4d'

Posted on 2007-12-02
38
1,975 Views
Last Modified: 2008-02-01
Microsoft JET Database Engine error '80040e4d'
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.


<%

Set objConn = CreateObject("ADODB.Connection")

Dim objConn

objConn.open = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='../access_db/ClickAuction.mdb';User Id=jeanbide;Password=Bide2007") 

objConn.close

set objConn = nothing

Response.Write("Connection Successful.")

%>

Open in new window

0
Comment
Question by:njdowd
  • 17
  • 11
  • 8
  • +2
38 Comments
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393211
Almost have it right.  If you define the connection string and then attempt to open the conneciton I believe you'll be fine.  Sample code below.
<%

    Dim objConn 

    Set objConn = CreateObject("ADODB.Connection")
 

    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='../access_db/ClickAuction.mdb';User ID = 'jeanbide';Jet OLEDB:Database Password='Bide2007';"
 

    objConn.Open

    objConn.Close

    Set objConn = Nothing
 

    Response.Write ("Connection Successful.")

%>

Open in new window

0
 
LVL 13

Expert Comment

by:samic400
ID: 20393212
couple things that probably aren't related -

should be server.createobject("adodb.connection")

and

I've never had an = sign in between my objConn.Open and connection string.

objConn.Open <your connection string here>
0
 
LVL 13

Expert Comment

by:samic400
ID: 20393239
What about this string?

objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='../access_db/ClickAuction.mdb';Jet OLEDB:Database Password='Bide2007';"
 
   
   
0
 
LVL 25

Expert Comment

by:kevp75
ID: 20393299
make sure the folder that the access database is in allows IUSR_machinname read/write/modify access to it, and well as the file itself.

Also, make sure that no-one has it open locally
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393326
Hi Samic400,

Good suggestion about the .ConnectionString (definitely on the right track).  Looks amazingly similar to what I posted 7 minutes earlier.  
In case the author is wondering why your suggestion, so very close to being right, doesn't work, I believe it will be due to the omition of the User ID included in the original sample code...

ID: 20393211 Author:Rick_Rickards Date:12.02.2007 at 05:29PM PST
Line 5 of Code Snippet...
    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='../access_db/ClickAuction.mdb';User ID = 'jeanbide';Jet OLEDB:Database Password='Bide2007';"

ID:20393239Author:samic400Date:12.02.2007 at 05:36PM PSTExpert Comment
3rd Line
     objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='../access_db/ClickAuction.mdb';Jet OLEDB:Database Password='Bide2007';"

If however, the author would like to avoid defining the ConnectionString on it's own line I figured I'd post an alternative approach that should work.

In any case I think we are in agreement that the .ConnectionString needed to be defined prioer to running the .Open Method but with all due respect I don't believe it's likely to work given the login information included in the authors question that was missing from your post.  Easy to overlook I know but probably will make all the difference.

There is, however, author would like to provide the connection string with the Open method I believe the following code will also work.  I did test the original code posted and for what it's worth I was able to reproduce the error njdowd made reference to.  In any case the code snippet above and below should resolve the problem.

<%

    Dim objConn 

    Set objConn = CreateObject("ADODB.Connection")

 

    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='../access_db/ClickAuction.mdb';User ID = 'jeanbide';Jet OLEDB:Database Password='Bide2007';"

    objConn.Close

    Set objConn = Nothing

 

    Response.Write ("Connection Successful.")

%>

Open in new window

0
 
LVL 13

Expert Comment

by:samic400
ID: 20393358
I guess I didn't see your response 7 minutes earlier. Just trying to help.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393381
No offense taken.  Was really more for your benefit given the omission of the User ID.  Ultimately I'm eager to see the author find the answer to their question.
0
 

Author Comment

by:njdowd
ID: 20393396
I have been looking for a way to respond. I appreciate the corrections to the code, but the results were the same. I believe that my problem lies with KevP75 might be on the right trail. However, I am not sure about how to do it. I do not have IIS installed on my local computers. I can install it on my work computer (I am doing some of it remotely), but the XP disk is at my office. I can't install it on my home computer as it is VISTA and apparently not a version that supports it.
I'm not exactly sure what to do next. This has been an all-day venture.
0
 

Author Comment

by:njdowd
ID: 20393418
Aha! Progress. It didn't stop at line 6; it stopped at line 8:     objConn.Open
Apparently, I didn't upload after the last iteration.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393420
If someone else has the file open you should find a file in the same folder with the extension .ldb.  If this turns out to be the case just say so and we can walk you thru the steps to kick whoever may be in the application out.

As for Read/Write/Modify permissions you may want to try creating a file, altering it and then deleting it in the folder, (any file will do).  If you can at least do that then you've at least got the permissions required for the folder itself.

Double Check the name of the .mdb file itself.  I noticed your path simply says...
    Data Source='../access_db/ClickAuction.mdb';

Having the wrong pathname will alos cause the same error you've sighted. You may want a more explicit path name such as...
    Data Source='C:/Dev/access_db/ClickAuction.mdb';

If the file is in someones Documents and settings folder this could easily be the cause.  The main thing is, try identifying the path explicitly rather than using ../access_db/ since you may be pointing to a folder other than the one you intended.  For example there's a huge difference between ../access_db/ and ./access_db/ so if you define the path exactly you can rule that issue out.

Another thing to confirm is that you have Read Access to the %Windows%/%System32% folder.  That is where the system.mdw file resides.  Doubt this is it but if you didn't have access to that folder you'd certainly have a problem.

Another thing that would be worth checking out is, after confirming the absence of an .ldb file in the .mdb file's folder that shares the same name as the .mdb, when you run the code and it crashes, do you have an .ldb file there.  If so, it actually started opening the file and if it managed to create the .ldb file we can be pretty sure you have write access to the folder.

Anyway there are a few things to get you started.  Any information on where this leaves you will help in determining what steps to take next.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393423
Line 8 of which code snippet?  Looking back neither example has the line objConn.Open on line 8?
0
 

Author Comment

by:njdowd
ID: 20393429
objConn.Open is on line 8 in my file.

It's really good to have someone with whom to discuss the issues.
<%

Dim objConn 

    Set objConn = CreateObject("ADODB.Connection")

 

    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='../access_db/ClickAuction.mdb';User ID = 'jeanbide';Jet OLEDB:Database Password='Bide2007';"

 

    objConn.Open

    objConn.Close

    Set objConn = Nothing

 

    Response.Write ("Connection Successful.")
 

%>

Open in new window

0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393447
This helps.  Do you have answers to any of my questions from post ID:20393420
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393450
Also are you still getting the same error message or did the message change?

Definately check the pathname of the .mdb.  I know for fact that if it was incorrect you'd get the error message from your original question....

     "Cannot start your application. The workgroup information file is missing or opened exclusively by another user."


0
 

Author Comment

by:njdowd
ID: 20393489
An .ldb file has not been created. It is not possible for anyone else to have the file open at this time.
I changed the reference to the database to c:/techventure/access_db/ClickAuction.mdb' . . .
Of course, the path on my computer is much longer than that, but it should be right for the server where it is being hosted.
I do have read access to Windows\System 32.
0
 

Author Comment

by:njdowd
ID: 20393497
Microsoft JET Database Engine error '80040e4d'
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.

/auction/includes/db.asp, line 8

The URL is http://www.techventures2007.com/Auction.  I am testing it here until I get it working.
0
 

Author Comment

by:njdowd
ID: 20393591
I really appreciate all your suggestions. I will tackle it again tomorrow, checking out those database permission issues. I will let you know my progress.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20393614
I'm pretty sure that Kevp75 was on the right track from the start based on everything posted thus far.

ID: 20393299 Author:kevp75 Date:12.02.2007 at 05:56PM PST

I Quote from Kevp75's post,  "make sure the folder that the access database is in allows IUSR_machinname read/write/modify access to it, and well as the file itself. Also, make sure that no-one has it open locally"

That said, some additional information may be helpful to get you to the finish line.  

First off, there are a couple KB article that addresses this issue.  They are...

http://support.microsoft.com/kb/174943/en-us
http://support.microsoft.com/kb/188712

Having read both I realize it may not be entirely clear what you need to do so I'll try to simplify what they are trying to say by the following instructions...

There is a user named IUSR_<machinename> where <machinename> is replaced with the name of the computer where IIS has been installed/computer hosting the web page.

Give the IUSR_<machinename> account full control to the ASP page, and the folder and files where the Access .mdb database is located.  In this case... "c:/techventure/access_db/ClickAuction.mdb
At a minimum IUSR_<machinename> needs Create, Destroy, Read, Write to work with the .ldb file. Specific permission can be applied to the database to limit access.
You may also need to grant some additional Read permissions to IUSR_<machinename> so that it can access the system.mdw located in C:/%Windows%/%System32%/System.mdw
0
 
LVL 84
ID: 20394784
You may also need to declare the path to the System.mdw file in your connect string. I've had this give troubles with ASP stuff before if the server hasn't been configured to grant access to that file. In some cases, simply doing something like this works:

objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='../access_db/ClickAuction.mdb';Jet OLEDB:Database Password='Bide2007';Jet OLEDB:System Database=Server.MapPath(system.mdw);User ID = 'jeanbide';Password=;"

If all else fails,you can copy your own system.mdw file up to a folder on the host machine and refer to that (just like you do the Data Source).
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:njdowd
ID: 20396236
Dear all;

I am still having issues. Not really sure how to get IIS to do what you are asking that we get it to do, could one of you give us a more detailed step-by-step thing to do what you say? Our website is remote hosted by godaddy, and so I am not sure if we have direct access to its permissions. Thank you very much for your help so far.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20396323
There is a user created by IIS with the name IUSR_Server (Note that what follows the underscore character _ is the name of the computer.  If The Computer's name was Server1 then the User created by IIS would be named IUSR_Server1).  To keep things simple I'll just keep refering to this user as IUSR_Server.

1) Go to the folder where the Access database is stored (file with the .mdb extension).  Grant Full Control Permissions to IUSR_Server for this folder.

2) Go to the folder where the ASP Pages is located.  Grant Full Control Permissions to IUSR_Server for this folder.

3) Locate the file named System.mdw.  It is usually located at a locations like the ones listed below....
    C:\Windows\System32\System.MDW
    C:\WINNT\System32\System.MDW
Once you locate the System.MDW file above Grant Full Control Permissions to IUSR_Server for this file.

If you need more details regarding how to grant permissions it will help to know which version of Windows the server is running.

Rick
0
 

Author Comment

by:njdowd
ID: 20396555
I'm still a bit confused. The files are not hosted on our computers or servers; rather, it is hosted by godaddy.com's computers and servers. As such, I cannot get direct access to either the files to change their permissions (maybe I can, but I don't know how) and I cannot change the stuff located in their c:\windows\system32\system.mdw. Maybe I'm just being really stupid, but it's not clear to me how to do this. Can  you please explain? Thank you very much.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20396611
If you don't have access to the sever, either at the consol or via some other thing such as Remote Deskto Connection, PC Anywhere, etc. you're at the mercy of whoever does have that kind of access sop that the changes can be made.

As for specific instructions on how to grant the permissions it'll be a lot esier to be specific once we know what version of Windows we are work with.

Question: What Version of windows is installed on the Server???

0
 

Author Comment

by:njdowd
ID: 20396640
I think they're using 2003 for their server.
0
 
LVL 16

Accepted Solution

by:
Rick_Rickards earned 250 total points
ID: 20396713
Once you're in front of the server or have remote access via remote desktop connection or other simmilar method you can grant permissions to folders and/or files to any user by locating the folder/file thru explorer (Clicking on My Computer will get you started).  Once you've found the folder/file point and RIGHT click the folder/file.  You'll see a tab called Security.  You'll see a list of users who have access to that folder/file with 2 buttons on the right (Add and Remove).  Click Add.  A new window will appear.  The combo Box at the to called Look In: should be changed to "Entire Directory".  Highlight the user named IUSR_SEVER and then click the Add Button.  This will bring you back to the Security Tab.  While the User named IUSR_Server is still highlighted you can click the check boxes in the Allow Column to give the user as much or as little access as you'd like.  There is an option called "Full Control" which is what you're going to want to select in this case.  Once done Click OK and repeate the process for the other folders/files.
0
 

Author Comment

by:njdowd
ID: 20397313
Rick, You have incredible patience, and I appreciate your prompt responses. You have helped me narrow the issues. This is where I believe we are:
GoDaddy support is almost useless, but I have concluded that they will only support File DSN even though they sent me instructions for DSN-less connections. I attached a copy of that code.
I cannot change the permissions on the remote folder. My response is: "access denied", and apparently the GoDaddy people can't/won't do it.
I wanted didn't want to do the DSN connections because I wanted to keep it simple. I felt that the fewer changes I made in the code, the higher likelihood of having it work. My final solution will be to have an SQL 5.0 database with a dsn connection, but I was going to do it in stages.
It looks as if we will have to go the DSN route.
What do you think?
ASP/ADO Access database Connection (Windows Only, DSN-Less connection):

<%

Set objConn = CreateObject("ADODB.Connection")

objConn.open = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='d:/hosting/joeshmoe/access_db/data.mdb';User Id=;Password=") 

objConn.close

set objConn = nothing

Response.Write("Connection Successful.")

%>

Open in new window

0
 

Author Comment

by:njdowd
ID: 20397359
Here are GoDaddy's comments: (which I have done)
Our Windows hosting accounts allow you to set up Access database support. Using the Hosting Control Center, you can automatically create an "access_db" directory where you can upload your access database files.

To Set up an Access Database for Your Web Site
Log in to your Account Manager.
In the My Products section, select Hosting Account List.
Next to the hosting account you want to modify, click Open.
In the Databases section of the Hosting Control Center, click the Access icon.
Click Enable Access Support. This creates a private directory in your hosting directory called "access_db." This directory will already have the appropriate database permissions set.
To Set up an Access Database for Your Web Site
Log in to your Account Manager.
In the My Products section, select Hosting Account List.
Next to the hosting account you want to modify, click Open.
In the Databases section of the Hosting Control Center, click the Access icon.
Click Enable Access Support. This creates a private directory in your hosting directory called "access_db." This directory will already have the appropriate database permissions set.
Once you enable Access database support by creating this directory, upload your Access database file to the "access_db" directory. The permissions on this directory allow anonymous Web users to read and write to the Access database through your scripts, but they cannot download your database.

0
 
LVL 13

Expert Comment

by:samic400
ID: 20397403
I took a peek at an old DSN connection string I had with a GoDaddy Site that I built a while ago and it worked fine. Not sure if this might help or not. But it used an access db.

sDSNDir = Server.MapPath("_dsn")

connectstr = "filedsn=" & sDSNDir & "\access_cart.dsn"

set mConn = server.CreateObject("ADODB.Connection")
mConn.Open connectstr


0
 

Author Comment

by:njdowd
ID: 20397671
I feel we are really close. Here is the latest error message:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
General error: Invalid file dsn ''

/Auction/includes/db.asp, line 18

<%

  dim oConn, oRs

  dim qry, connectstr, sDSNDir

  dim db_name, db_username, db_userpassword

  dim db_server, dsn_name

  dim filedsn

  

  dsn_name = "access_.dsn"

  db_name = "clickauction.mdb"

  db_username = "jeanbide"

  

   sDSNDir = Server.MapPath("_dsn")
 

connectstr = "filedsn=" & sDSNDir & "" & dsn_name
 

set oConn = server.CreateObject("ADODB.Connection")

oConn.Open connectstr
 

%>

Open in new window

0
 
LVL 13

Expert Comment

by:samic400
ID: 20397739
<%
  dim oConn, oRs
  dim qry, connectstr, sDSNDir
  dim db_name, db_username, db_userpassword
  dim db_server, dsn_name
  dim filedsn
 
  dsn_name = "access_.dsn"
  db_name = "clickauction.mdb"
  db_username = "jeanbide"
 
   sDSNDir = Server.MapPath("_dsn")
 
connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
 
set oConn = server.CreateObject("ADODB.Connection")
oConn.Open connectstr
 
%>
0
 

Author Comment

by:njdowd
ID: 20398227
Is
   sDSNDir = Server.MapPath("_dsn")
correct?
Or should it map to the access_db folder?
0
 
LVL 13

Expert Comment

by:samic400
ID: 20398283
I have a folder on my Goddady client's site that is "_dsn". In that folder is my "access_cart.dsn".

I'm thinking, if you FTP to that site, that you should have a "_dsn" folder and within it, your dsn entry should be named "access_.dsn". Then your access db probably resides in the "access_db" folder, which "access_.dsn" points to.

0
 

Author Comment

by:njdowd
ID: 20398916
I just had the most amazingly useless conversation with GoDaddy. Thank you for being useful.
You are right on. My current question is: Does that path mean the line should be:
sDSNDIR = Server.MapPath("../access_db")?
0
 
LVL 13

Assisted Solution

by:samic400
samic400 earned 250 total points
ID: 20399063
I think it should be this:

sDSNDir = Server.MapPath("_dsn")
dsn_name = "access_.dsn"
connectstr = "filedsn=" & sDSNDir & "\" & dsn_name

I think in the control panel on the godaddy web site, you need to point your access_.dsn name to your "clickauction.mdb" access db, which should be in the access_db folder. I cannot recall how to do that though. I just remember I set up the DSN stuff on the godaddy web site.

0
 

Author Comment

by:njdowd
ID: 20399288
Bless your heart! I missed that one. Godaddy site does ask for the file name. I am testing it now. I find when I work within our Network, it takes a few minutes for the site to refresh itself. So I will let you know if it works.
0
 

Author Comment

by:njdowd
ID: 20400748
Now that we are going the DSN route, here is my latest iteration. I really can't see anything wrong. I fixed the DSN setup on GoDaddy.
<%
 

Dim oConn, oRs

Dim qry, connectstr, sDSNDir

Dim db_name, db_username, db_userpassword

Dim db_server, dsn_name
 

dsn_name = "access_bideup.dsn"

db_name = "bideup.mdb"

'tablename = "your_tablename"
 

sDSNDir = Server.MapPath("_dsn")
 

connectstr = "filedsn=" & sDSNDir & "" & dsn_name
 

Set oConn = Server.CreateObject("ADODB.Connection")
 

oConn.Open connectstr
 

%>

Open in new window

0
 
LVL 13

Expert Comment

by:samic400
ID: 20401967
you need a \

connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
0
 

Author Comment

by:njdowd
ID: 20414741
The winning solution:
The DSN had the wrong path
The DSN was pointing to a database that didn't exist the db.asp file was updated and the name of the variable that held the connection string was changed (which would make the rest of the site not
work)
This answer came from the people who wrote the original code, and I did ask them first. Finally, on begging knees, they helped me find the answer.

Many kudos to you guys. You were right on target. I believe my problem was that I had set up two DSNs on GoDaddy and it was only posting one. The one he found was not the one that I was addressing. I really appreciate all the support you gave.
<%

Dim dbc, oRs

Dim qry, connectstr, sDSNDir

Dim db_name, db_username, db_userpassword

Dim db_server, dsn_name

 

dsn_name = "access_ClickAuction.dsn"

 

sDSNDir = Server.MapPath("..\_dsn")

 

connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
 

 

Set dbc = Server.CreateObject("ADODB.Connection")
 

 

dbc.Open connectstr
 
 

%>

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

706 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

19 Experts available now in Live!

Get 1:1 Help Now