Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: VS: Re: VS: JET-error '80004005' unspecified error


Message #1 by "Teemu Keiski" <wroxhelp@m...> on Tue, 4 Jun 2002 23:00:46 +0300
I don't see "objConn.Close" anywhere, but if you say you are closing it
then it's ok (Setting it Nothing isn't enough, you have to close it
also).

And after you have used objRecordset you can close that too with
"objRecordset.Close" and set it to Nothing even if it isn't created
explicitly. I don't see that either. =3D)

Otherwise code you provided is ok.

Teemu Keiski

-----Alkuper=E4inen viesti-----
L=E4hett=E4j=E4: Stephan [mailto:stephan_bussing@h...]
L=E4hetetty: 4. kes=E4kuuta 2002 20:55
Vastaanottaja: Access ASP
Aihe: [access_asp] Re: VS: JET-error '80004005' unspecified error


Thx for the advice, I'm still seaching with google but with the first
error message. There's also a lot about that, but not what I'm looking
for. Actually I do close al the objects en open them on every request.

Here's some code you asked for, I use this code in a DataAccessClass,
this
piece of code executes the insert, update and delete-query's:

Public Property Get DbExecute

 DbCommandType =3D "Execute"

'		Connect, if necessary, to the database
%>
 <!--#include file=3D"DatabaseConnectProperties.asp"-->
<%
  Set objConn =3D Server.CreateObject("ADODB.Connection")
  objConn.Open ConnectString

  Set cmdSP =3D Server.CreateObject("ADODB.Command")
  cmdSP.CommandText =3D strStoredProcedure
  cmdSP.CommandType =3D adCmdStoredProc
  cmdSP.ActiveConnection =3D objConn
  for RecordTeller =3D 0 to (ParamCounter -1)
    if arrayParamIO(Recordteller) =3D "i" then
      if arrayParamTypes(RecordTeller) =3D adVarChar then
	set parSP(RecordTeller) =3D cmdSP.CreateParameter( arrayParamNames

(RecordTeller), arrayParamTypes(RecordTeller), adParamInput, 
arrayParamSizes(RecordTeller))
      elseif arrayParamTypes(RecordTeller) =3D adChar then
	set parSP(RecordTeller) =3D cmdSP.CreateParameter( arrayParamNames
(RecordTeller), arrayParamTypes(RecordTeller), adParamInput,
arrayParamSizes(RecordTeller))
      else
	set parSP(RecordTeller) =3D cmdSP.CreateParameter( arrayParamNames
(RecordTeller), arrayParamTypes(RecordTeller), adParamInput)
      end if
      cmdSP.Parameters.Append parSP(RecordTeller)
      parSP(RecordTeller).Value =3D arrayParamValues(RecordTeller)
	elseif arrayParamIO(Recordteller) =3D "o" then
          if arrayParamTypes(RecordTeller) =3D adVarChar then
	    set parSP(RecordTeller) =3D cmdSP.CreateParameter(
arrayParamNames(RecordTeller), arrayParamTypes(RecordTeller),
adParamOutput, arrayParamSizes(RecordTeller))
	  elseif arrayParamTypes(RecordTeller) =3D adChar then
	    set parSP(RecordTeller) =3D cmdSP.CreateParameter(
arrayParamNames(RecordTeller), arrayParamTypes(RecordTeller),
adParamOutput, arrayParamSizes(RecordTeller))
	  else
	    set parSP(RecordTeller) =3D cmdSP.CreateParameter(
arrayParamNames(RecordTeller), arrayParamTypes(RecordTeller),
adParamOutput)
	  end if
	  cmdSP.Parameters.Append parSP(RecordTeller)
	end if
   next

   cmdSP.Execute
	=09
   Set objRecordSet  =3D objConn.Execute("SELECT @@IDENTITY")
   intReturnValue =3D objRecordSet(0)

   If IsObject(cmdSP) Then
     Set cmdSP =3D nothing
   End If=09
	=09
   If IsObject(objConn) Then
     Set ObjConn =3D nothing
   End If=09
End Property

Well, that's it.

Thx


> Try to search with Google using: "[ODBC Microsoft Access-driver] Too
many client-tasks". You'll find quite a list there. =3D3D)

Check that you are closing all objects properly when you are executing
those queries and doing that checking. Are you using Recordsets or
straight Command objects? If possible post some more code.

Teemu Keiski

-----Alkuper=3DE4inen viesti-----
L=3DE4hett=3DE4j=3DE4: Stephan [mailto:Stephan_bussing@h...]=3D20
L=3DE4hetetty: 4. kes=3DE4kuuta 2002 20:06
Vastaanottaja: Access ASP
Aihe: [access_asp] JET-error '80004005' unspecified error


Hi Guys, I was wondering if anyone has the solution for the 
following=3D20
problem:

I'm using MS Access 2000, PWS, Win 98. At the moment I'm developing 
a=3D20
webapp based on ASP and a MS Access DB. Everything seems to work 
fine=3D20
until I have to execute a few query's in one function. This function
first=3D20 checks if the record already exists, if it doesn't is does an
insert=3D20 otherwise is wil go on to the next check. This works fine 
for,
let's say,=3D20 30 records (so 30 selects and 30 inserts), but with 50
records or more I

get the message: Microsoft JET-Database Engine Error '80004005'=3D20
Unspecified Error. The error point to a line in my code where the=3D20
connection to de db is made. But there's nothing wrong with this=3D20
connections otherwise the first few records couldn't be inserted too.

I already installed the latest MDAC version (2.7) en JET OLEDB SP.
This=3D20 didn't help.

I use the following connectionstring:=3D20

"Provider=3D3DMicrosoft.Jet.OLEDB.4.0;Data=3D20
Source=3D3Dd:\project\data\access.mdb;User ID=3D3D;Password=3D3D;"

When I change te connectionstring to:
"filedsn=3D3DD:\projecten\data\ms_access.dsn;DefaultDir=3D3Dfiledsn=3D3DD
:\pro
j=3D
ecten
\da
ta;DBQ=3D3DD:\projecten\data\access.mdb;" =3D20

An other error occurs:

Access Driver:

Microsoft OLE DB Provider for ODBC Drivers fout '80040e4d'=3D20
[Microsoft][ODBC Microsoft Access-driver] Too many client-tasks.=3D20
/_admin/include/ClassDataAccess.asp, line 171=3D20

But when I run my application on my providers webserver. There's no=3D20
problem. Of course there's other software installed on there 
system.=3D20
Windows 2000 and IIS 5. But still I'm wondering why it goes wrong on
my=3D20 system. Does anyone has any suggestions.

Thx in advance.

Greetzzz

Stephan
mailto:Stephan_bussing@h...
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to 


Message #2 by "Stephan" <stephan_bussing@h...> on Tue, 4 Jun 2002 22:06:37
Thanks again, you pushed me in the right direction. Now explicitly look 
the ConnectionObject and the insert are going ok. Now I have to figure out 
when to close the connection when I use a recordset.

The other thing you mentioned, closing te recordset, is done, I just 
forgot is copy the right code into this mail.

Anyway you helped me a lot. I will try to get the rest working too.


> I don't see "objConn.Close" anywhere, but if you say you are closing it
then it's ok (Setting it Nothing isn't enough, you have to close it
also).

And after you have used objRecordset you can close that too with
"objRecordset.Close" and set it to Nothing even if it isn't created
explicitly. I don't see that either. =3D)

Otherwise code you provided is ok.

Teemu Keiski

-----Alkuper=E4inen viesti-----
L=E4hett=E4j=E4: Stephan [mailto:stephan_bussing@h...]
L=E4hetetty: 4. kes=E4kuuta 2002 20:55
Vastaanottaja: Access ASP
Aihe: [access_asp] Re: VS: JET-error '80004005' unspecified error


Thx for the advice, I'm still seaching with google but with the first
error message. There's also a lot about that, but not what I'm looking
for. Actually I do close al the objects en open them on every request.

Here's some code you asked for, I use this code in a DataAccessClass,
this
piece of code executes the insert, update and delete-query's:

Public Property Get DbExecute

 DbCommandType =3D "Execute"

'		Connect, if necessary, to the database
%>
 <!--#include file=3D"DatabaseConnectProperties.asp"-->
<%
  Set objConn =3D Server.CreateObject("ADODB.Connection")
  objConn.Open ConnectString

  Set cmdSP =3D Server.CreateObject("ADODB.Command")
  cmdSP.CommandText =3D strStoredProcedure
  cmdSP.CommandType =3D adCmdStoredProc
  cmdSP.ActiveConnection =3D objConn
  for RecordTeller =3D 0 to (ParamCounter -1)
    if arrayParamIO(Recordteller) =3D "i" then
      if arrayParamTypes(RecordTeller) =3D adVarChar then
	set parSP(RecordTeller) =3D cmdSP.CreateParameter( arrayParamNames

(RecordTeller), arrayParamTypes(RecordTeller), adParamInput, 
arrayParamSizes(RecordTeller))
      elseif arrayParamTypes(RecordTeller) =3D adChar then
	set parSP(RecordTeller) =3D cmdSP.CreateParameter( arrayParamNames
(RecordTeller), arrayParamTypes(RecordTeller), adParamInput,
arrayParamSizes(RecordTeller))
      else
	set parSP(RecordTeller) =3D cmdSP.CreateParameter( arrayParamNames
(RecordTeller), arrayParamTypes(RecordTeller), adParamInput)
      end if
      cmdSP.Parameters.Append parSP(RecordTeller)
      parSP(RecordTeller).Value =3D arrayParamValues(RecordTeller)
	elseif arrayParamIO(Recordteller) =3D "o" then
          if arrayParamTypes(RecordTeller) =3D adVarChar then
	    set parSP(RecordTeller) =3D cmdSP.CreateParameter(
arrayParamNames(RecordTeller), arrayParamTypes(RecordTeller),
adParamOutput, arrayParamSizes(RecordTeller))
	  elseif arrayParamTypes(RecordTeller) =3D adChar then
	    set parSP(RecordTeller) =3D cmdSP.CreateParameter(
arrayParamNames(RecordTeller), arrayParamTypes(RecordTeller),
adParamOutput, arrayParamSizes(RecordTeller))
	  else
	    set parSP(RecordTeller) =3D cmdSP.CreateParameter(
arrayParamNames(RecordTeller), arrayParamTypes(RecordTeller),
adParamOutput)
	  end if
	  cmdSP.Parameters.Append parSP(RecordTeller)
	end if
   next

   cmdSP.Execute
	=09
   Set objRecordSet  =3D objConn.Execute("SELECT @@IDENTITY")
   intReturnValue =3D objRecordSet(0)

   If IsObject(cmdSP) Then
     Set cmdSP =3D nothing
   End If=09
	=09
   If IsObject(objConn) Then
     Set ObjConn =3D nothing
   End If=09
End Property

Well, that's it.

Thx


> Try to search with Google using: "[ODBC Microsoft Access-driver] Too
many client-tasks". You'll find quite a list there. =3D3D)

Check that you are closing all objects properly when you are executing
those queries and doing that checking. Are you using Recordsets or
straight Command objects? If possible post some more code.

Teemu Keiski

-----Alkuper=3DE4inen viesti-----
L=3DE4hett=3DE4j=3DE4: Stephan [mailto:Stephan_bussing@h...]=3D20
L=3DE4hetetty: 4. kes=3DE4kuuta 2002 20:06
Vastaanottaja: Access ASP
Aihe: [access_asp] JET-error '80004005' unspecified error


Hi Guys, I was wondering if anyone has the solution for the 
following=3D20
problem:

I'm using MS Access 2000, PWS, Win 98. At the moment I'm developing 
a=3D20
webapp based on ASP and a MS Access DB. Everything seems to work 
fine=3D20
until I have to execute a few query's in one function. This function
first=3D20 checks if the record already exists, if it doesn't is does an
insert=3D20 otherwise is wil go on to the next check. This works fine 
for,
let's say,=3D20 30 records (so 30 selects and 30 inserts), but with 50
records or more I

get the message: Microsoft JET-Database Engine Error '80004005'=3D20
Unspecified Error. The error point to a line in my code where the=3D20
connection to de db is made. But there's nothing wrong with this=3D20
connections otherwise the first few records couldn't be inserted too.

I already installed the latest MDAC version (2.7) en JET OLEDB SP.
This=3D20 didn't help.

I use the following connectionstring:=3D20

"Provider=3D3DMicrosoft.Jet.OLEDB.4.0;Data=3D20
Source=3D3Dd:\project\data\access.mdb;User ID=3D3D;Password=3D3D;"

When I change te connectionstring to:
"filedsn=3D3DD:\projecten\data\ms_access.dsn;DefaultDir=3D3Dfiledsn=3D3DD
:\pro
j=3D
ecten
\da
ta;DBQ=3D3DD:\projecten\data\access.mdb;" =3D20

An other error occurs:

Access Driver:

Microsoft OLE DB Provider for ODBC Drivers fout '80040e4d'=3D20
[Microsoft][ODBC Microsoft Access-driver] Too many client-tasks.=3D20
/_admin/include/ClassDataAccess.asp, line 171=3D20

But when I run my application on my providers webserver. There's no=3D20
problem. Of course there's other software installed on there 
system.=3D20
Windows 2000 and IIS 5. But still I'm wondering why it goes wrong on
my=3D20 system. Does anyone has any suggestions.

Thx in advance.

Greetzzz

Stephan
mailto:Stephan_bussing@h...
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to 


Message #3 by "Stephan" <stephan_bussing@h...> on Tue, 4 Jun 2002 23:07:16
Keemu, thank you very much. I thought that set object=nothing also 
destroyed the connection. Now that I explicitly close the connection 
everything works fine. So this was indeed the problem.

Thanks again.

Greetzzz
Message #4 by "Teemu Keiski" <wroxhelp@m...> on Wed, 5 Jun 2002 12:12:22 +0300
Teemu, not Keemu. =)

Yes, set connectionobject=Nothing only destroys the reference to your
connection object but still leaves it open. Connection must be closed before
destroying it.

If I remember right, closing rs explicitly isn't absolute must, because
closing connection should close also all opened recordsets (with that
particular connection). Of course, it's best practise to close then
explicitly so one can always be sure what happens and when (that makes
application less error-prone).

Teemu Keiski

-----Original Message-----
From: Stephan [mailto:stephan_bussing@h...]
Sent: 4. kesäkuuta 2002 23:07
To: Access ASP
Subject: [access_asp] Re: VS: Re: VS: JET-error '80004005' unspecified
error


Keemu, thank you very much. I thought that set object=nothing also
destroyed the connection. Now that I explicitly close the connection
everything works fine. So this was indeed the problem.

Thanks again.

Greetzzz


  Return to Index