Microsoft OLE DB Provider for ODBC Drivers error '80004005'

Discussion in 'Software' started by medwayis, Jul 10, 2006.

  1. medwayis

    medwayis Private E-2

    I get 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 0x2f0 Thread 0xeb4 DBC 0x15c96e4 Jet'.

    /login/First_Time.asp, line 46

    I checked the cache file, TMP, TEMP. all ok. ODBC can see the file, "USERS.MDB" I made sure the IIS server here is setup to run asp scripts.

    Here is the url to test the script.

    http://www.cyberev.org/login/register.asp

    I looked and looked, I'm missing something. What could it be??

    Helpl !?!?:confused:
     
  2. matt.chugg

    matt.chugg MajorGeek

    Hi Medwayis

    Welcome to MajorGeeks

    Have you seen this: MS KB Article

    It contains instructions to fix your problem.

    Matt
     
  3. medwayis

    medwayis Private E-2

    Yes, been there, tried that. No luck.
     
  4. matt.chugg

    matt.chugg MajorGeek

    Where is the TMP var pointing and does the web asp process have permissions set correctly on that folder ?

    I tend to use ASP.NET and have never really had any problems with oledb so sorry if I'm not helping much.

    Matt
     
  5. medwayis

    medwayis Private E-2

    You have a point. I did look in that. All tmp,temp runs out of system. Did look at access policy's. all ok.

    Other than that, this is an .ASP app that worked a few months ago, but today I needed to change some fields in the mdb file and no I'm stuck in the pickle barrel. I did do a rollback to last known state, same error. I have no clue as to what might have gone out the window. :-(
     
  6. matt.chugg

    matt.chugg MajorGeek

    Im at a bit of a loss now. Perhaps you could point the TMP and TEMP vars to a non system location and set the permissions on them to allow everyone Full access ?

    Remember to back up your settings first! ;)

    Matt
     
  7. medwayis

    medwayis Private E-2

    Tried it. Rebooted server. nothing..

    This is a 2003 standard server.

    Here is a sample of where I'm stuck at:

    " VALUES ('" & strFirstName & "','" & strLastName & "', '" & strStreetAddress & "', '" & strCity & "', '" & strState & "', '" & strZipCode & "', '" & strEmailAddress & "', '" & strUserName & "', '" & strUserPassword & "', '" & _
    strDate & "');"

    Set Conn=Server.CreateObject("ADODB.Connection")
    Conn.Open strDSNPath --> Here is where it stops.
    On error resume next
    Conn.Execute strSQL_Insert
    Conn.Close
    Set Conn = Nothing

    ____________________________________________________________

    the error reads:

    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x2f0 Thread 0xb64 DBC 0x15d9014 Jet'

    -- now the Temorary word that is underlined, seems to say it's a caching problem. however, the word "VOLATILE" seems to indicate that it's a memory problem.

    Am I right?
     
  8. matt.chugg

    matt.chugg MajorGeek

    whats your connection string ?

    Also you should use parametrized sql to prevent exploits like SQL Injection.

    Matt
     
  9. medwayis

    medwayis Private E-2

    Connection -->
    Set Conn=Server.CreateObject("ADODB.Connection")
    Conn.Open strDSNPath
    On error resume next
    Conn.Execute strSQL_Insert
    Conn.Close
    Set Conn = Nothing
    _____________________________________________________________

    Here's the code that get processed from line 1 to 46. I have copied only 62 lines instead of all 199 lines.



    <%@ Language=VBScript %>
    <%
    if Request.ServerVariables("REQUEST_METHOD") = "POST" then

    strFirstName = Request.Form("txtFirstName")
    strLastName = Request.Form("txtLastName")
    strStreetAddress = Request.Form("txtStreetAddress")
    strCity = Request.Form("txtCity")
    strState = Request.Form("txtState")
    strZipCode = Request.Form("txtZipCode")
    strEmailAddress = Request.Form("txtEmailAddress")
    strUserName = Request.Form("txtUserName")
    strUserPassword = Request.Form("txtUserPassword")
    strEntryDate = Now()

    blnValid = True
    strValid = "<p><font face=Arial color=black><b>" & _
    "Invalid entry...!!!</b></font></p>" & vbCrLf & _
    "<ul><font face=Arial size=2>" & vbCrLf

    if strFirstName = "" then
    blnValid = False
    strValid = strValid & "<li><b><font color=""black"">Please Re-Enter Your First Name!</b></font><br>" & vbCrLf
    end if


    if strUserName = "" then
    blnValid = False
    strValid = strValid & "<li><b><font color=""black"">Please Re-Enter Your UserName!</b></font><br>" & vbCrLf
    end if

    if strEmailAddress = "" then
    blnValid = False
    strValid = strValid & "<li><font color=""black""><b>Please Re-Enter Your Email Address!.&nbsp;(All Email Addresses are to include the @ sign.)</b></font><br>" & vbCrLf

    end if

    if blnValid = True then

    strDSNPath = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db\users.mdb")
    strSQL_Insert = "INSERT INTO CustRecords ( FirstName, LastName, StreetAddress, City, State, ZipCode, EmailAddress, UserName, UserPassword )" & _
    " VALUES ('" & strFirstName & "','" & strLastName & "', '" & strStreetAddress & "', '" & strCity & "', '" & strState & "', '" & strZipCode & "', '" & strEmailAddress & "', '" & strUserName & "', '" & strUserPassword & "', '" & _
    strDate & "');"

    Set Conn=Server.CreateObject("ADODB.Connection")
    Conn.Open strDSNPath
    On error resume next
    Conn.Execute strSQL_Insert
    Conn.Close
    Set Conn = Nothing

    if err.number > 0 then

    strValid = "<p align=center><font face=Arial size=4 color=black><b>" & _
    "Sorry, your Username/Password has been used by someone else!<br>" & _
    "<br>Please choose different Username/Password</br>" & _
    "</b></font></p>" & _
    "<p align=center><font face=Arial color=#8000FF><b>" & _
    "</b></font></p>" & _
    "<p align=center><font face=Arial color=#8000FF><b>" & _
    "</b></font></p>"
    else
     
  10. matt.chugg

    matt.chugg MajorGeek

    Check the permissions on the database folder too. I've had issues with that before, it may need some kind of share on it too.

    Matt
     
  11. medwayis

    medwayis Private E-2

    Good oone. Added everyone to the list. NOPE..
     
  12. matt.chugg

    matt.chugg MajorGeek

    Pah

    Im running out of ideas!


    Matt
     
  13. medwayis

    medwayis Private E-2

    question, what's the differance between these 2:

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/USERNAME/db/users.mdb")

    and

    "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db\users.mdb")
     
  14. medwayis

    medwayis Private E-2

    I got the 1st one from my online blogger on the same website which is working fine.
     
  15. matt.chugg

    matt.chugg MajorGeek

    The top one uses Jet (and is the same as the one I normally use) the second one uses MSDASQL;DRIVER (which I don't know about)

    I'd personally use the first one.

    Matt
     
  16. medwayis

    medwayis Private E-2

    so, I could technically use the following as:

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & Server.MapPath("db\users.mdb")

    inplace of
    "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db\users.mdb")
     
  17. medwayis

    medwayis Private E-2

    When I made the change.. I get the following:

    Microsoft VBScript compilation error '800a0401'

    Expected end of statement

    /login/First_Time.asp, line 40

    strDSNPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & Server.MapPath("db\users.mdb")
    ------------------------------------------------------------------------------^
     
  18. matt.chugg

    matt.chugg MajorGeek

    Yes.

    As far as I remember the Jet provider is part of windows so it should always be there.

    Matt
     
  19. medwayis

    medwayis Private E-2

    I made the chage, I get the following error:

    Microsoft VBScript compilation error '800a0401'

    Expected end of statement

    /login/First_Time.asp, line 40

    strDSNPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & Server.MapPath("db\users.mdb")
    ------------------------------------------------------------------------------^
     
  20. matt.chugg

    matt.chugg MajorGeek

    your quotes.........

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db\users.mdb") & ";"
     
  21. matt.chugg

    matt.chugg MajorGeek

  22. medwayis

    medwayis Private E-2

    Ok that's fixed, so to speak., It apears to be in a loop back into it's self.
     
  23. medwayis

    medwayis Private E-2

    Once they get registered, it supposed to go to index.html from members.
     
  24. matt.chugg

    matt.chugg MajorGeek

    Your code post stops just before the 'else' so I can't see what you are using to redirect it.
     
  25. medwayis

    medwayis Private E-2

    ahhh &*&^%% !!

    Here's the hole shabang.

    <%@ Language=VBScript %>
    <%
    if Request.ServerVariables("REQUEST_METHOD") = "POST" then

    strFirstName = Request.Form("txtFirstName")
    strLastName = Request.Form("txtLastName")
    strStreetAddress = Request.Form("txtStreetAddress")
    strCity = Request.Form("txtCity")
    strState = Request.Form("txtState")
    strZipCode = Request.Form("txtZipCode")
    strEmailAddress = Request.Form("txtEmailAddress")
    strUserName = Request.Form("txtUserName")
    strUserPassword = Request.Form("txtUserPassword")
    strEntryDate = Now()

    blnValid = True
    strValid = "<p><font face=Arial color=black><b>" & _
    "Invalid entry...!!!</b></font></p>" & vbCrLf & _
    "<ul><font face=Arial size=2>" & vbCrLf

    if strFirstName = "" then
    blnValid = False
    strValid = strValid & "<li><b><font color=""black"">Please Re-Enter Your First Name!</b></font><br>" & vbCrLf
    end if


    if strUserName = "" then
    blnValid = False
    strValid = strValid & "<li><b><font color=""black"">Please Re-Enter Your UserName!</b></font><br>" & vbCrLf
    end if

    if strEmailAddress = "" then
    blnValid = False
    strValid = strValid & "<li><font color=""black""><b>Please Re-Enter Your Email Address!.&nbsp;(All Email Addresses are to include the @ sign.)</b></font><br>" & vbCrLf

    end if

    if blnValid = True then

    strDSNPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db\users.mdb") & ";"
    strSQL_Insert = "INSERT INTO CustRecords ( FirstName, LastName, StreetAddress, City, State, ZipCode, EmailAddress, UserName, UserPassword )" & _
    " VALUES ('" & strFirstName & "','" & strLastName & "', '" & strStreetAddress & "', '" & strCity & "', '" & strState & "', '" & strZipCode & "', '" & strEmailAddress & "', '" & strUserName & "', '" & strUserPassword & "', '" & _
    strDate & "');"

    Set Conn=Server.CreateObject("ADODB.Connection")
    Conn.Open strDSNPath
    On error resume next
    Conn.Execute strSQL_Insert
    Conn.Close
    Set Conn = Nothing

    if err.number > 0 then

    strValid = "<p align=center><font face=Arial size=4 color=black><b>" & _
    "Sorry, your Username/Password has been used by someone else!<br>" & _
    "<br>Please choose different Username/Password</br>" & _
    "</b></font></p>" & _
    "<p align=center><font face=Arial color=#8000FF><b>" & _
    "</b></font></p>" & _
    "<p align=center><font face=Arial color=#8000FF><b>" & _
    "</b></font></p>"
    else

    strValid = "<h2 align=center><i><font face=Arial color=black><b>" & _
    "Welcome " & strFirstName & "&nbsp;" & strLastName & "<br> " & _
    "</b></font></u></i></h2><br>" & _
    "<h3 align=center><font face=Arial color=black><b>Your name and password entered our database</font></b></h3><br>" & _
    "<p align=center><font face=Arial color=Gold><b>" & _
    "</b></font></p>"
    end if

    else
    strValid = strValid & "<table align=""center""border=3>"&_
    "<tr> <td><form action=""First_Time.asp"" method=""POST"" name=""form1""> "&_
    "<tr><td align=""Left""><b><font color=""black"">First Name:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtFirstName""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Last Name:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtLastName""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Street Address:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtStreetAddress""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">City:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtCity""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">State:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtState""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Zip Code:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtZipCode""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Email Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtEmailAddress""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">User Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtUserName""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">User Password:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""password"" name=""txtUserPassword""maxlength=""10""></b></tr></td>" & _
    "<tr><td><br><input type=""Submit"" value=""Re-Try""></tr></td> "& _
    "</table>"
    end if
    else

    Response.whiteirect("index.asp")

    end if

    %>
    <HTML>
    <HEAD>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>Cyberev Registration</title>
    <meta http-equiv="refresh" content="0;URL=register.asp">
    </HEAD>
    <body>
    <div align="center">
    <table WIDTH="600" ALIGN="center" BORDER="0" CELLSPACING="3" CELLPADDING="3">
    <STYLE>BODY {

    SCROLLBAR-FACE-COLOR: #336699; SCROLLBAR-HIGHLIGHT-COLOR: #336699; SCROLLBAR-SHADOW-COLOR: #336699; SCROLLBAR-3DLIGHT-COLOR: #336699; SCROLLBAR-ARROW-COLOR: black; SCROLLBAR-TRACK-COLOR: #999999; SCROLLBAR-DARKSHADOW-COLOR: #444444

    }

    A {

    COLOR: #003399; FONT-FAMILY: verdana; FONT-SIZE: 100%; FONT-WEIGHT: bold; TEXT-DECORATION: none

    }

    A:visited {

    COLOR: #003399; FONT-FAMILY: verdana; FONT-SIZE: 100%

    }

    A:hover {

    COLOR: red; FONT-FAMILY: verdana; FONT-SIZE: 100%; TEXT-DECORATION: underline

    }

    .y {

    COLOR: #ffffcc

    }

    .y:active {

    COLOR: #ffffcc

    }

    .y:visited {

    COLOR: #ffffcc

    }

    </STYLE>
    <br>
    <tr>
    <td><%
    Response.Write strValid
    %></td>
    </tr>
    </table>
    <% Response.Write "Please wait a moment, We will take you to the Members Area ...</a>"
    %></div>
    </BODY>
    </HTML>
     
  26. matt.chugg

    matt.chugg MajorGeek

    Tip if you put tabs in your code it makes it more readable.

    Code:
    if err.number > 0 then
    
    	strValid = "<p align=center><font face=Arial size=4 color=black><b>" & _
    			"Sorry, your Username/Password has been used by someone else!<br>" & _
    			"<br>Please choose different Username/Password</br>" & _
    			"</b></font></p>" & _
    			"<p align=center><font face=Arial color=#8000FF><b>" & _
    			"</b></font></p>" & _
    			"<p align=center><font face=Arial color=#8000FF><b>" & _
    			"</b></font></p>"
    else
    
    	strValid = "<h2 align=center><i><font face=Arial color=black><b>" & _
    			"Welcome " & strFirstName & "&nbsp;" & strLastName & "<br> " & _
    			"</b></font></u></i></h2><br>" & _
    			"<h3 align=center><font face=Arial color=black><b>Your name and password entered our database</font></b></h3><br>" & _
    			"<p align=center><font face=Arial color=Gold><b>" & _
    			"</b></font></p>" 
    end if 
    
    ' Whats this else doing here?! its not part of an if
    
    else 
    strValid = strValid & "<table align=""center""border=3>"&_
    "<tr> <td><form action=""First_Time.asp"" method=""POST"" name=""form1""> "&_
    "<tr><td align=""Left""><b><font color=""black"">First Name:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtFirstName""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Last Name:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtLastName""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Street Address:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtStreetAddress""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">City:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtCity""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">State:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtState""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Zip Code:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtZipCode""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">Email Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtEmailAddress""></b></tr></tr></td><br><br>" & _ 
    "<tr><td align=""Left""><b><font color=""black"">User Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""text"" name=""txtUserName""></b></tr></tr></td><br><br>" & _
    "<tr><td align=""Left""><b><font color=""black"">User Password:&nbsp;&nbsp;&nbsp;&nbsp;</font><input type=""password"" name=""txtUserPassword""maxlength=""10""></b></tr></td>" & _
    "<tr><td><br><input type=""Submit"" value=""Re-Try""></tr></td> "& _
    "</table>"
    end if 
    else
    
    Response.whiteirect("index.asp")
    
    end if 
    
    See the comment in the code. your if statments don't seem to make sense

    Matt
     
  27. medwayis

    medwayis Private E-2

    %>
    <HTML>
    <HEAD>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>Cyberev Registration</title>
    <meta http-equiv="refresh" content="0;URL=register.asp">
    </HEAD>
    <body>
    <div align="center">
    <table WIDTH="600" ALIGN="center" BORDER="0" CELLSPACING="3" CELLPADDING="3">
    <STYLE>BODY {

    SCROLLBAR-FACE-COLOR: #336699; SCROLLBAR-HIGHLIGHT-COLOR: #336699; SCROLLBAR-SHADOW-COLOR: #336699; SCROLLBAR-3DLIGHT-COLOR: #336699; SCROLLBAR-ARROW-COLOR: black; SCROLLBAR-TRACK-COLOR: #999999; SCROLLBAR-DARKSHADOW-COLOR: #444444

    }

    A {

    COLOR: #003399; FONT-FAMILY: verdana; FONT-SIZE: 100%; FONT-WEIGHT: bold; TEXT-DECORATION: none

    }

    A:visited {

    COLOR: #003399; FONT-FAMILY: verdana; FONT-SIZE: 100%

    }

    A:hover {

    COLOR: red; FONT-FAMILY: verdana; FONT-SIZE: 100%; TEXT-DECORATION: underline

    }

    .y {

    COLOR: #ffffcc

    }

    .y:active {

    COLOR: #ffffcc

    }

    .y:visited {

    COLOR: #ffffcc

    }

    </STYLE>
    <br>
    <tr>
    <td><%
    Response.Write strValid
    %></td>
    </tr>
    </table>
    <% Response.Write "Please wait a moment, We will take you to the Members Area ...</a>"
    %></div>
    </BODY>
    </HTML>
     
  28. matt.chugg

    matt.chugg MajorGeek

    From what I can tell you only have one redirect and because of the problems with your 'ifs' its going to happen each time

    Matt
     
  29. medwayis

    medwayis Private E-2

    It's suppoed to write to users.mdb.
     
  30. medwayis

    medwayis Private E-2

    I should have seem that comming. I think I'll rewrite it from scratch.. Some old bloke wrote this and left the company. I thould I could say myself hundreds of hours of programming.

    Thanks for all your help. By the way, You do know what you doing. If anyone else says otherwise, tell them to take a flying leap somewhere..

    Again, Thanks a million.. :- )
     
  31. matt.chugg

    matt.chugg MajorGeek

    The other problem is your error trapping: your calling err.number but you have no error trapping. Its been a while since I used normal vb (im a .net person) but you need something like:

    Code:
    On Error Goto ErrorHandler
    
    	Do DB Stuff
    
    	Insert blah blah blah 
    
    	response.redirect("done.asp") '(if it failed then you wouldn't be here you'd be at the errorhandler)
    
    
    Exit Sub
    
    ErrorHandler:
    
    'Handle Errors
    
    Select case err.number
    	
    	case 0
    		'something went wrong
    	case 1
    		'something went wrong
    
    	case else
    		'unknown error'
    
    On Error Goto 0 ' stop error checking
    
     
  32. matt.chugg

    matt.chugg MajorGeek

    also... have you considered asp.net ? ;) much nicer

    Thanks

    Matt
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds