Click to See Complete Forum and Search --> : [RESOLVED] Microsoft OLE DB Provider for ODBC Drivers error '80004005'


landslide
02-16-2007, 07:06 PM
this is the error it is giving.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Could not update; currently locked by user 'admin' on machine GPWWW

/Ss/lvc/Jas/jve.asp, line 54

on line 54 app all that is on there is the execute command

What could be causing this error. The page that this happens on is a page that updates multiple records on a page. It appears to only do this if thier is a large number of records to update and it only does this randomly. Sometimes it accepts it other times it does not.

russell
02-17-2007, 11:58 AM
sounds like someone has the database open.

landslide
02-17-2007, 10:45 PM
thats what i thought but I am the only one with accsess and it only does this randomly when I try to update multiple records. Is there anything else that can cause this.

russell
02-18-2007, 12:42 AM
how are u updating the multiple records? perhaps u have it locked from another thread. remember, ms access is a single-user application, even when used as a web back end.

landslide
02-20-2007, 02:37 PM
How can I check to see if another tread is still open also how would I close any other treads? Here is my code Thanks<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../../../Connections/lvcc.asp" -->
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_lvcc_STRING;
Recordset1.Source = "SELECT tblJanuary.SSN, tblJanuary.EOD, [tblJanuary.Last four], tblJanuary.firstname, tblJanuary.lastname, tblJanuary.ORGCODE, tblTollFreeEmployees.SCD, tblJanuary.SEID, tblJanuary.jan10, tblJanuary.extra2, tblJanuary.timestamp1 FROM tblJanuary, tblTollFreeEmployees WHERE [tblTollFreeEmployees.SEID] = [tblJanuary.SEID] and tblJanuary.jan10 LIKE ('R%')ORDER BY tblJanuary.EOD, SCD, [Last Four]";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;

arjan10 = new Array();
arSeid = new Array();

var f=new Enumerator(Request.Form);
var el;
var start;
var len;
var idx;


for (; !f.atEnd(); f.moveNext()) {
el = f.item().toString().toLowerCase();
start = el.indexOf("_");

if(start > -1) {
start++; len = el.length - start;
idx = parseInt(el.substr(start, len));

if(!isNaN(idx)) {
if(el.indexOf("jan10")!=-1) arjan10[idx] = Request.Form(el);
if(el.indexOf("seid")!=-1) arSeid[idx] = Request.Form(el);
}
}
}

for(var i=0;i<arSeid.length;i++) {
if(arjan10[i] && arSeid[i]) {
updateDB (arjan10[i], arSeid[i]);
}
else {
Response.Write("");
}
}

function updateDB(param_jan10, param_seid) {
var update = Server.CreateObject("ADODB.Command");
update.ActiveConnection = MM_lvcc_STRING;
update.CommandText = update.CommandText = "UPDATE tblJanuary SET Jan10 = '" + param_jan10 + "' WHERE seid = '" + param_seid + "'";
update.CommandType = 1;
update.CommandTimeout = 0;
update.Prepared = true;
update.Execute();
}

var Repeat1__numRows = -1;
var Repeat1__index = 0;
Recordset1_numRows += Repeat1__numRows;
%>
<%
var Recordset2__MMColParam = "1";
if (String(Session("MM_Username")) != "undefined" &&
String(Session("MM_Username")) != "") {
Recordset2__MMColParam = String(Session("MM_Username"));
}
%>
<%
var Recordset2 = Server.CreateObject("ADODB.Recordset");
Recordset2.ActiveConnection = MM_lvcc_STRING;
Recordset2.Source = "SELECT LASTNAME, FIRSTNAME, SEID FROM Adminlogin WHERE SEID = '"+ Recordset2__MMColParam.replace(/'/g, "''") + "'";
Recordset2.CursorType = 0;
Recordset2.CursorLocation = 2;
Recordset2.LockType = 1;
Recordset2.Open();
var Recordset2_numRows = 0;
%>
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_lvcc_STRING;
Recordset1.Source = "SELECT tblJanuary.SSN, tblJanuary.EOD, [tblJanuary.Last four], tblJanuary.firstname, tblJanuary.lastname, tblJanuary.ORGCODE, tblTollFreeEmployees.SCD, tblJanuary.SEID, tblJanuary.jan10, tblJanuary.extra2, tblJanuary.timestamp1 FROM tblJanuary, tblTollFreeEmployees WHERE [tblTollFreeEmployees.SEID] = [tblJanuary.SEID] and tblJanuary.jan10 LIKE ('R%')ORDER BY tblJanuary.EOD, SCD, [Last Four]";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--

function doCalcs(form1){
count = form1.lvavalbl.value;
for(x=0; x<document.getElementsByName('jan10').length; x++){
document.getElementsByName('jan10')[x].value = (count > 0) ? 'A' : 'D'
count --;
}
}
//-->
</script>
<style type="text/css">
<!--
.style8 { font-size: 24px;
font-weight: bold;
}
body {
background-color: #0099ff;
}
.style10 {font-size: 10px}
-->
</style>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jan10</title>
<style type="text/css">
<!--
.style7 {font-size: 9px}
.style9 {font-size: 12px}
-->
</style>
</head>

<body>
<p align="right"><a href="Jan11approve.asp">Click here to continue to the next day. </a></p>
<p align="center"><span class="style10">Approved by <span class="style11"><%=(Recordset2.Fields.Item("FIRSTNAME").Value)%>&nbsp; <%=(Recordset2.Fields.Item("LASTNAME").Value)%></span></span></p>
<p align="center"><span class="style8">January 10th </span></p>
<form method="post" id="form1" name="form1" action="">
<p align="center">Input the amount of leave that can be given
<input name="lvavalbl" type="text" id="lvavalbl" size="2" onblur="doCalcs(form1)"/>
</P>
<table border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><div align="center"><span class="style7">ID</span></div></td>
<td><div align="center"><span class="style7">EOD</span></div></td>
<td><div align="center"><span class="style7">SCD</span></div></td>
<td><div align="center"><span class="style7">Last four</span></div></td>
<td><div align="center"><span class="style7">First Name</span></div></td>
<td><div align="center"><span class="style7">Last Name</span></div></td>
<td><div align="center"><span class="style7">ORGCODE</span></div></td>
<td><div align="center"><span class="style7">SEID</span></div></td>
<td><div align="center"><span class="style7">Jan10</span></div></td>
<td><div align="center"><span class="style7">Timestamp</span></div></td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!Recordset1.EOF)) { %>
<tr>
<td><span class="style7"><%=(Recordset1.Fields.Item("SSN").Value)%></span></td>
<td><span class="style9"><%=(Recordset1.Fields.Item("EOD").Value)%></span></td>
<td><span class="style9"><%=(Recordset1.Fields.Item("SCD").Value)%></span></td>
<td><span class="style7"><%=(Recordset1.Fields.Item("Last four").Value)%></span></td>
<td><span class="style9"><%=(Recordset1.Fields.Item("firstname").Value)%></span></td>
<td><span class="style9"><%=(Recordset1.Fields.Item("lastname").Value)%></span></td>
<td><span class="style7"><%=(Recordset1.Fields.Item("ORGCODE").Value)%></span></td>
<td><input name="seid_<%=Repeat1__index%>" type="text" id="seid_<%=Repeat1__index%>" value="<%=(Recordset1.Fields.Item("SEID").Value)%>" size="5" maxlength="5" readonly="<%=(Recordset1.Fields.Item("SEID").Value)%>" /></td>
<td><input name="jan10_<%=Repeat1__index%>" type="text" id="jan10" value="<%=(Recordset1.Fields.Item("jan10").Value)%>" size="4" /></td>
<td><span class="style7"><%=(Recordset1.Fields.Item("timestamp1").Value)%></span></td>
</tr>
<%
Repeat1__index++;
Recordset1.MoveNext();
}
%>
</table>
<p align="center">
<input name="Submit2" type="submit" value="Submit" />
</p>
</form>
</body>
</html>
<%
Recordset1.Close();
%>
<%
Recordset2.Close();
%>

landslide
02-22-2007, 03:42 PM
Anyone have any ideas on why it is doing this?

russell
02-22-2007, 04:17 PM
i still think someone has the database open...sure it isnt you?

also, on the web server make sure that no instance of msaccess is running (using task manager).

then destroy the object -- after this line
update.Execute();
add this
update = null;

landslide
02-23-2007, 02:03 PM
Well the distroy didnt work so your probably right. I do not have access to the server task manager. How can I find out if that is the problem. I know the oddveous answer is contact the administraor. Is thier anything I can do from here?

russell
02-23-2007, 02:40 PM
is this your web site? do u ftp files to the server?

landslide
02-23-2007, 05:40 PM
Its on a LAN. I map to the network drive through our internal network. I only am given accsess to our website folder on the server nothing else. If I need changes to IIS it is done by the server administrator for that server.

russell
02-23-2007, 11:04 PM
have server admin make sure db isnt open.

landslide
03-16-2007, 03:43 PM
Ok i made sure it is not open on the server. I have been testing this page forever. It only appears to give me this message when I have to update more than 7 records at a time. I have to hit refeash several times for it to accept it. The reason I dont think it is open is beacuse I am the only on with accsess to it, I have contacted the server administrator to ensure it is not open he says it is not. The other reason is bscause when I hit submit I will get the error message. Then I go back and hit submit again imeaditly and it will update it. Of course i dont know much. Any other possible ideas?

landslide
03-16-2007, 05:28 PM
A friend sent me this could this be the problem? Try closing the record set and the connection objects each time it calls updateDB. I think what is happening is that you are creating a new connection with each call of the function, when you have numerous records, it eventually reached the limit of allowed connections. You may also just try creating the connection object once and reusing it.

landslide
03-19-2007, 11:30 AM
Anyone have any ideas?

landslide
03-19-2007, 02:49 PM
Any ideas on this. Anything?

russell
03-19-2007, 06:41 PM
should always explicitly close and destroy connection objects. what happened when u tried it?

landslide
03-19-2007, 07:13 PM
I tried to distroy it adding this
update = null; but i still get the same error.

landslide
03-19-2007, 08:24 PM
Could this be the problem? I found it while researching. http://www.15seconds.com/faq/ODBC/478.htm

landslide
03-20-2007, 07:26 PM
Ok nevermind that last post Im sure this is the problem but Im not sure how to rewrite this anyone help http://support.microsoft.com/kb/331594

landslide
03-21-2007, 03:07 PM
Nope thats not the problem, But I did find this and this is exactly what is happening to me. http://forums.microsoft.com/msdn/showpost.aspx?postid=973628&siteid=1

landslide
03-21-2007, 03:54 PM
I think this might solve it Use client-side cursor to access the data. Not sure how to do that any ideas.


Back to the top

landslide
03-21-2007, 10:59 PM
Ok I got this from msn. It explains the problem but I cant find the solution. Ahhhhh some one help. wheres the man when you need em Russell where are you :(
It is good practice to always close a recordset as well as a database at the
end of the procedure. Your problem of being locked out could be due to the
fact that the database is opened in several procedures, but then never closed.
However, you should be able to make changes or gather information from a
table that is being use by more than one user or process. When you create
a recordset whether in ADO or DAO the open recordset function allows you
to set the lockedits so that you can make changes.

russell
03-22-2007, 02:43 PM
you are closing your recordsets. as far as cursorlocation

Recordset1.CursorLocation = 2;

may want a look here:
http://www.w3schools.com/ado/ado_ref_recordset.asp

let's see what your code looks like now

landslide
03-22-2007, 03:18 PM
Im not sure where to put that I think I already have that in thier.<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../../../Connections/lvcc.asp" -->
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_lvcc_STRING;
Recordset1.Source = "SELECT tblJanuary.SSN, tblJanuary.EOD, [tblJanuary.Last four], tblJanuary.firstname, tblJanuary.lastname, tblJanuary.ORGCODE, tblTollFreeEmployees.SCD, tblJanuary.SEID, tblJanuary.jan4, tblJanuary.extra2, tblJanuary.timestamp1 FROM tblJanuary, tblTollFreeEmployees WHERE [tblTollFreeEmployees.SEID] = [tblJanuary.SEID] and tblJanuary.jan4 LIKE ('R%')ORDER BY tblJanuary.EOD, SCD, [Last Four]";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;

arjan4 = new Array();
arSeid = new Array();

var f=new Enumerator(Request.Form);
var el;
var start;
var len;
var idx;


for (; !f.atEnd(); f.moveNext()) {
el = f.item().toString().toLowerCase();
start = el.indexOf("_");

if(start > -1) {
start++; len = el.length - start;
idx = parseInt(el.substr(start, len));

if(!isNaN(idx)) {
if(el.indexOf("jan4")!=-1) arjan4[idx] = Request.Form(el);
if(el.indexOf("seid")!=-1) arSeid[idx] = Request.Form(el);
}
}
}

for(var i=0;i<arSeid.length;i++) {
if(arjan4[i] && arSeid[i]) {
updateDB (arjan4[i], arSeid[i]);
}
else {
Response.Write("");
}
}

function updateDB(param_jan4, param_seid) {
var update = Server.CreateObject("ADODB.Command");
update.ActiveConnection = MM_lvcc_STRING;
update.CommandText = update.CommandText = "UPDATE tblJanuary SET Jan4 = '" + param_jan4 + "' WHERE seid = '" + param_seid + "'";
update.CommandType = 1;
update.CommandTimeout = 0;
update.Prepared = true;
update.Execute();
update = null;}

var Repeat1__numRows = -1;
var Repeat1__index = 0;
Recordset1_numRows += Repeat1__numRows;
%>
<%
var Recordset2__MMColParam = "1";
if (String(Session("MM_Username")) != "undefined" &&
String(Session("MM_Username")) != "") {
Recordset2__MMColParam = String(Session("MM_Username"));
}
%>
<%
var Recordset2 = Server.CreateObject("ADODB.Recordset");
Recordset2.ActiveConnection = MM_lvcc_STRING;
Recordset2.Source = "SELECT LASTNAME, FIRSTNAME, SEID FROM Adminlogin WHERE SEID = '"+ Recordset2__MMColParam.replace(/'/g, "''") + "'";
Recordset2.CursorType = 0;
Recordset2.CursorLocation = 2;
Recordset2.LockType = 1;
Recordset2.Open();
var Recordset2_numRows = 0;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--

function doCalcs(form1){
count = form1.lvavalbl.value;
for(x=0; x<document.getElementsByName('jan4').length; x++){
document.getElementsByName('jan4')[x].value = (count > 0) ? 'A' : 'D'
count --;
}
}
//-->
</script>
<style type="text/css">
<!--
.style8 {
font-size: 24px;
font-weight: bold;
}
body {
background-color: #0099FF;
}
.style11 {font-weight: bold}
-->
</style>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jan4</title>
<style type="text/css">
<!--
.style7 {font-size: 9px}
.style9 {font-size: 10px}
.style10 {font-size: 12px}
-->
</style>
</head>

<body>
<p align="right"><a href="Jan5approve.asp">Click here to continue to the next day. </a></p>
<p align="center" class="style9">Approved by <span class="style11"><%=(Recordset2.Fields.Item("FIRSTNAME").Value)%>&nbsp; <%=(Recordset2.Fields.Item("LASTNAME").Value)%></span></p>
<form method="post" id="form1" name="form1" action="">
<p align="center" class="style8">January 4th </p>
<p align="center">Input the amount of leave that can be given
<input name="lvavalbl" type="text" id="lvavalbl" size="2" onblur="doCalcs(form1)"/>
</P>
<table border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><div align="center"><span class="style7">ID</span></div></td>
<td><div align="center"><span class="style7">EOD</span></div></td>
<td><div align="center"><span class="style7">SCD</span></div></td>
<td><div align="center"><span class="style7">Last four</span></div></td>
<td><div align="center"><span class="style7">First Name</span></div></td>
<td><div align="center"><span class="style7">Last Name</span></div></td>
<td><div align="center"><span class="style7">ORGCODE</span></div></td>
<td><div align="center"><span class="style7">SEID</span></div></td>
<td><div align="center"><span class="style7">jan4</span></div></td>
<td><div align="center"><span class="style7">timestamp1</span></div></td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!Recordset1.EOF)) { %>
<tr>
<td><span class="style7"><%=(Recordset1.Fields.Item("SSN").Value)%></span></td>
<td><span class="style10"><%=(Recordset1.Fields.Item("EOD").Value)%></span></td>
<td><span class="style10"><%=(Recordset1.Fields.Item("SCD").Value)%></span></td>
<td><span class="style7"><%=(Recordset1.Fields.Item("Last four").Value)%></span></td>
<td><span class="style10"><%=(Recordset1.Fields.Item("firstname").Value)%></span></td>
<td><span class="style10"><%=(Recordset1.Fields.Item("lastname").Value)%></span></td>
<td><span class="style7"><%=(Recordset1.Fields.Item("ORGCODE").Value)%></span></td>
<td><input name="seid_<%=Repeat1__index%>" type="text" id="seid_<%=Repeat1__index%>" value="<%=(Recordset1.Fields.Item("SEID").Value)%>" size="5" maxlength="5" readonly="<%=(Recordset1.Fields.Item("SEID").Value)%>" /></td>
<td><input name="jan4_<%=Repeat1__index%>" type="text" id="jan4" value="<%=(Recordset1.Fields.Item("jan4").Value)%>" size="4" /></td>
<td><span class="style7"><%=(Recordset1.Fields.Item("timestamp1").Value)%></span></td>
</tr>
<%
Repeat1__index++;
Recordset1.MoveNext();
}
%>
</table>
<p align="center">
<input name="Submit2" type="submit" value="Submit" />
</p>
</form>
</body>
</html>
<%
Recordset1.Close();
%>
<%
Recordset2.Close();
%>

landslide
03-23-2007, 06:08 PM
My goal is to figure this one out this weekend no matter what. Please anyone that can help please help me figure out this one so my wife does not kill me over the weekend. Im not kidding she will kill me she told me so (Kidding). Anyway if anyone has any ideas please give your input. I so want to put this one behind me.

landslide
03-24-2007, 07:43 PM
anyone please help

russell
03-26-2007, 05:51 AM
try changing cursor location to 3.

landslide
03-26-2007, 12:15 PM
No it still gives me the same message. I did change the lock type to 4 and that seem to help some. It does not give me the message as often any other ideas?

landslide
03-30-2007, 03:02 PM
Any one have any Ideas on this?

landslide
04-02-2007, 10:32 PM
Anyone?

I.m.I
04-04-2007, 08:51 PM
why u open the Recordset1 in the first lines???
<!--#include file="../../../Connections/lvcc.asp" -->
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_lvcc_STRING;
Recordset1.Source = "SELECT tblJanuary.SSN, tblJanuary.EOD, [tblJanuary.Last four], tblJanuary.firstname, tblJanuary.lastname, tblJanuary.ORGCODE, tblTollFreeEmployees.SCD, tblJanuary.SEID, tblJanuary.jan10, tblJanuary.extra2, tblJanuary.timestamp1 FROM tblJanuary, tblTollFreeEmployees WHERE [tblTollFreeEmployees.SEID] = [tblJanuary.SEID] and tblJanuary.jan10 LIKE ('R%')ORDER BY tblJanuary.EOD, SCD, [Last Four]";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();

landslide
04-04-2007, 10:33 PM
Im new at this. I open the recordset at the beggining to automaticly load the records that need to be modified when the page loads. All I am trying to do is update this page with out that error. AHhhh for the love of God please someone give me the answer!!! Give me a sign, some one give me a sign to the answer. The wife is about to beat me again for not spending time with her. Please some help!!.... here she comes im gonna go hide.

I.m.I
04-05-2007, 05:36 AM
try to remove this code from ur page


var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_lvcc_STRING;
Recordset1.Source = "SELECT tblJanuary.SSN, tblJanuary.EOD, [tblJanuary.Last four], tblJanuary.firstname, tblJanuary.lastname, tblJanuary.ORGCODE, tblTollFreeEmployees.SCD, tblJanuary.SEID, tblJanuary.jan10, tblJanuary.extra2, tblJanuary.timestamp1 FROM tblJanuary, tblTollFreeEmployees WHERE [tblTollFreeEmployees.SEID] = [tblJanuary.SEID] and tblJanuary.jan10 LIKE ('R%')ORDER BY tblJanuary.EOD, SCD, [Last Four]";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();


than open the connection

landslide
04-05-2007, 07:47 PM
wHOOO I fixed it. All I needed after my update statment was update.ActiveConnection.Close(); Thanks for your help.

NetAdmn
08-07-2008, 11:48 AM
landslide I think I am having the same problem as you were here. Can you tell me where should I be putting "update.ActiveConnection.Close();" ????