Link to home
Start Free TrialLog in
Avatar of geertrobberechts
geertrobberechts

asked on

I've got an Microsoft OLE DB Provider for ODBC Drivers error '80004005'

Hello,

I work with ASP 3.0 on a IIS-server. Website: http://www.prono-foot.be
I use a connectionless-DSN to connect to my database (see tools.inc beneath)
Everything works fine with my database but after a while I've got the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open
registry key 'Temporary (volatile) Jet DSN for process 0x4e8 Thread 0x824 DBC 0xb9a1024 Jet'.

 /tools.inc, line 7

Sometimes this error-code appears and the morning after everything works again !
The code for my connection-string to open and close the database: (=tools.inc)

<%
Dim conntemp
set conntemp  = nothing
function OpenDB()
set OpenDB=server.createobject("adodb.connection")
strConnect = "DBQ=\\premfs2\sites\premium6\MEMBER\database\foot.mdb" & ";Driver={Microsoft Access Driver (*.mdb)};" & "PWD=pasw123"
OpenDB.open strConnect
end function

sub CloseDB
conntemp.close
set conntemp=nothing
end sub
%>

Last night I (08/08/01) I had the same problem , In the beginning it works fine and after a while I've got the error (see above). Than the morning after 09/08/01 the problem disappeared ! Can it be that two persons try to open my database at the same time and that it blocks or what can the problem be ? , it can't be my connectionstring because sometimes it works and sometimes it doesn't

Yours sincerely
Geert Robberechts

Avatar of hongjun
hongjun
Flag of Singapore image

Try to change your connection string to OLEDB.
http://www.adopenstatic.com/faq/whyOLEDB.asp

hongjun
So now your connection is as follows.

strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
             "\\premfs2\sites\premium6\MEMBER\database\foot.mdb");" & _
             "Password=pasw123;"


hongjun
If you still get errors, check to make sure that you have MDAC v2.1 SP2 or later installed on your server.
To get the latest MDAC goto http://www.microsoft.com/data

hongjun
Your answers to why use OLEDB and not ODBC is given by my above link
http://www.adopenstatic.com/faq/whyOLEDB.asp

hongjun
Avatar of geertrobberechts
geertrobberechts

ASKER

I've done what you said now I've got another error-message:

Microsoft JET Database Engine error '80040e4d'

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

tools.inc, line 15
Your database is configured to open it exclusive instead of shared. You can change this by opening you db in access, choose tools -> options. In the advanced-tab you can specify this. You can also change the locking (default = no lock).

I think the security should be ok, since you said that it worked before. The anonymous user should have write permission to the directory where the db is (for writing a temporary working file).

Another problem, looking at the result you got, could be that some security is set to your db to allow only certain UNanonymous users who are known in your domain/workgroup.

As I understand, the db is on another server? Otherwise you could try it with a DSN, but it will probably give the same error.
I've done what you said now I've got another error-message:

Microsoft JET Database Engine error '80040e4d'

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

tools.inc, line 15
Comment to DirkVe :
I checked my database and it is shared and there are no Locks. But my database is hosted on www.Brinkster.com 
I can't play as administrator. So I suppose I have to use a
DSN-less connection .
Aha, Brinkster that sounds familiar.

I suggest using the function server.mappath to connect to your database. Here's some working code that I used once (also on Brinkster) and it works !!!

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("db\MyDB.mdb") & ";Persist Security Info=False"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open strConn

I have a database named Mydb.mdb in the db folder (as Brinkster suggests it). Eventually you can of course put it in another folder, but maybe it's more secure there (don't know why Brinkster suggests it otherwise).


Comment to DirkVe :
I checked my database and it is shared and there are no Locks. But my database is hosted on www.Brinkster.com 
I can't play as administrator. So I suppose I have to use a
DSN-less connection .
Reply to DirkVe's comment:

But I'm a Premium member I pay for my web-hosting: so I have a /webroot and a /database directory instead of /db directory like the non-paying members. also Brinkster says to put the database-files in the /database directory for security reasons and they suggest to use the following code:


<%
Dim conntemp
set conntemp  = nothing
function OpenDB()
set OpenDB=server.createobject("adodb.connection")
strConnect = "DBQ=\\premfs2\sites\premium6\MEMBER\database\foot.mdb" & ";Driver={Microsoft Access Driver
(*.mdb)};" & "PWD=pasw123"
OpenDB.open strConnect
end function

sub CloseDB
conntemp.close
set conntemp=nothing
end sub
%>


Try the following code:

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("db\MyDB.mdb") & ";Persist
Security Info=False"

<%
Dim conntemp
set conntemp  = nothing
function OpenDB()
set OpenDB=server.createobject("adodb.connection")

strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("database\foot.mdb") & ";Persist
Security Info=False" & "PWD=pasw123"

OpenDB.open strConnect
end function

sub CloseDB
conntemp.close
set conntemp=nothing
end sub
%>

This will work as long as you database is on the same site as your asp-page.

Give it a try and let me know if it works. The reason why Brinkster suggest the other way is probably to allow accessing the databse from another site also. And most important: they 'suggest', and they don't 'oblige'. What concerns security: there's no difference in the 2 solutions.
ASKER CERTIFIED SOLUTION
Avatar of DirkVe
DirkVe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Reply to DirkVe's comment:

But I'm a Premium member I pay for my web-hosting: so I have a /webroot and a /database directory instead of /db directory like the non-paying members. also Brinkster says to put the database-files in the /database directory for security reasons and they suggest to use the following code:


<%
Dim conntemp
set conntemp  = nothing
function OpenDB()
set OpenDB=server.createobject("adodb.connection")
strConnect = "DBQ=\\premfs2\sites\premium6\MEMBER\database\foot.mdb" & ";Driver={Microsoft Access Driver
(*.mdb)};" & "PWD=pasw123"
OpenDB.open strConnect
end function

sub CloseDB
conntemp.close
set conntemp=nothing
end sub
%>


Hai,

this problem is due to the permission denied may be. Check the following things.. Check the ldb file created when the database is open is still there in the same folder.

Then give the permission to the Machine name
i.e IUSR_Machine  previledges.

The next thing is check the sharing of the folder.


Example database connection
<%
Set con = Server.CreateObject("ADODB.Connection")
con.ConnectionTimeout = 15
con.CommandTimeout =  10
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("database\dailyReports.mdb")
Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "insert into dailyReports values('"& saveDate&"',"&saveChannels&","&saveMarconi&","&saveSe2025&","&saveSe2028&","&totalCalls&")"
Response.Write "update completed"
rs.Open SQL,con,3, 3
Response.Redirect "index.htm"
Response.Flush


%>


With Cheers
Reply to DirkVe's comment:

But I'm a Premium member I pay for my web-hosting: so I have a /webroot and a /database directory instead of /db directory like the non-paying members. also Brinkster says to put the database-files in the /database directory for security reasons and they suggest to use the following code:


<%
Dim conntemp
set conntemp  = nothing
function OpenDB()
set OpenDB=server.createobject("adodb.connection")
strConnect = "DBQ=\\premfs2\sites\premium6\MEMBER\database\foot.mdb" & ";Driver={Microsoft Access Driver
(*.mdb)};" & "PWD=pasw123"
OpenDB.open strConnect
end function

sub CloseDB
conntemp.close
set conntemp=nothing
end sub
%>


Test This:

<%
Dim conntemp
set conntemp  = nothing
function OpenDB()
set OpenDB=server.createobject("adodb.connection")

strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("..\database\foot.mdb") & 
";Persist
Security Info=False" & "PWD=pasw123"

OpenDB.open strConnect
end function

sub CloseDB
conntemp.close
set conntemp=nothing
end sub
%>

PS: I know you are a Premlium user and... <cut>  So you don't have so send that a 4th time ;-)
Avatar of Michel Sakr
If Setting IUSR permissions on the mdb doesn't work then there aren't any permissions set in the tmp dir try this also..

http://support.microsoft.com/support/kb/articles/Q174/9/43.ASP
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=115



Why does Access give me 'unspecified error' messages?     (262 requests)
Aside from the improper use of MEMO fields (see FAQ #9), this may be caused by the mode in which Access is opened. Unless otherwise specified, IIS opens Access databases with adModeUnknown... which has proven to cause random problems in certain configurations. You can overcome this by setting the mode to adModeReadWrite *before* opening the connection, such as:
 
<%
    cst = "Driver={Microsoft Access Driver (*.mdb)};DBQ="
    cst = cst & server.mappath("/<pathtofile.mdb>")
    set conn = server.createobject("adodb.connection")
    conn.mode = 3 ' adModeReadWrite
    conn.open cst
%>
 
(If you know you have Jet 4.0 installed, you can use the following slightly more efficient method.)
 
<%
    cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    cst = cst & server.mappath("/<pathtofile.mdb>")
    set conn = server.createobject("adodb.connection")
    conn.mode = 3 ' adModeReadWrite
    conn.open cst
%>



also

ODBC connections are very flaky producing a variety of run-time error messages that OLEDB connections do not.  This sample uses an OLEDB connection hence it's "microsoft.jet.oledb...." vs. a connection string that contains "{microsoft access...}". The latter connection string/ODBC connection is far less reliable. See:
http://www.learnasp.com/learn/dbopen.asp for more connection string info. For example: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xda8 Thread 0x49c DBC 0x254d024 Jet'. occurs when connecting to data with "{microsoft access..." connection string whereas exactly the same data can be accessed with "Jet.oledb" string fine.

<Test Script Below>

<HTML><HEAD><TITLE>accesstest.asp</TITLE></HEAD>
<body bgcolor="#FFFFFF">
<%
on  error resume next
myconn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("nwind.mdb") & ";"
' the above string is recommended way to connect
' myconn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("nwind.mdb") & ";"
' the above connect string is VERY flaky
dim test(256)
dim errn(256)
dim errd(256)
for counter=1 to 255
   set test(counter)=server.createobject("adodb.connection")
   goodconn=true
   test(counter).open myconn
   ' have to test error here because if conn cant be created
   ' the errcount... line will fail
   vbserror=err.number
   errcount=test(counter).errors.count
   IF errcount>0 then
       DBErrNum=test(counter).errors(0).number
       DBErrDes=test(counter).errors(0).description  
    errn(counter)=DBErrNum
      errd(counter)="ADO: " & DBErrDes
      goodconn=false
   END IF

   ' VBScript Error Trap
   IF vbserror<>0 THEN
      errn(counter)=vbserror
      errd(counter)="VBS: " & err.description
      goodconn=false
   END IF
   If goodconn=true THEN
      errn(counter)=0
      success=success+1
   END IF
   response.flush
NEXT
for counter=1 to 255
   test(counter).close
   set test(counter)=nothing
next
response.write "Successful connections=" & success & "<br>"

for counter = 1 To 255
   errnum=errn(counter)
   IF errnum<>0 THEN
      response.write "#" & counter & " connection failed:"
      response.write errd(counter) & "<br>"
   END IF
next
%>
</BODY></HTML>
The error "Cannot start your application. The workgroup information file is missing or opened exclusively by another user. " will also be caused if you try to open a secured access database without also uploading and referencing the system.mdw security file associated with the database in your connect string.

regards,

Dave Kawliche
http://AccessHelp.net
http://1ClickDB.com
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> You cannot delete a question with comments, special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process for further information, if needed.  https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.
https://www.experts-exchange.com/questions/Q.20034613.html
https://www.experts-exchange.com/questions/Q.20076937.html
https://www.experts-exchange.com/questions/Q.20165672.html
https://www.experts-exchange.com/questions/Q.20262772.html
https://www.experts-exchange.com/questions/Q.20264870.html
https://www.experts-exchange.com/questions/Q.20262777.html




PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.