Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2006, 09:32 AM
Authorized User
 
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Default ODBC Drivers error '8007000e'

Hi,

after writing some ASP pages I cam up with this error.

===
Microsoft OLE DB Provider for ODBC Drivers error '8007000e'

[Microsoft][Controlador ODBC dBase] Se excedieron los recursos del sistema.
===

I believe it has to do something because I didn´t close good all the connections.
So I all the code so it always closes the conection, before going to the next page.
Still I ca´t get it running. Now i have to re-start the server with the DB.
Is there a way to do so without resetting the server?

Please if I am wrong about that the error goes away closing the conections, please tell me!!!
Thx,

Johny




 
Old October 24th, 2006, 09:40 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I can't read Spanish so I don't know what your exact error message is =\ If it is what I *think* it is look through your asp code do you open a connection and execute more then 1 query on that connection?? So:

Open Connection
Select Statement
Insert Statement
Close Connection

(Or something similiar)

If you are infact doing this, don't. This is, more or less, a bug in ASP the second query you execute will NOT use the connection you have opened, ASP will create its own connection to execute the query and then you are at its mercy as to If and When it closes that connection (you can't close it because you didnt explicity create it) and this causes a memory leak and leads to the server running out of resources.

Instead Open your connection execute your query close your connection and open and close it again for any subsequent queries.

hth

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old October 24th, 2006, 10:10 AM
Authorized User
 
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi dparsons,
so using the next code would be leaking the sources?


Set conn = server.createobject("adodb.connection")
conn.open "DSN=MYDB"
set rs = server.createobject("adodb.recordset")
sql="Select * from TABLE WHERE NAME=XXX"
=
doing stuff with the code
=
rs.Close
Conn.Close
Set rs=Nothing
Set Conn=Nothing


What should I then leave out?

The last 4 lines?


 
Old October 24th, 2006, 10:22 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No that should not cause a Memory leak.

If you were to do:

sql="Select * from TABLE WHERE NAME=XXX"
rs.open sql
//do stuff
sql="INSERT INTO table(columns)VALUES(data)
rs.open sql
//do stuff
rs.Close
Conn.Close
Set rs=Nothing
Set Conn=Nothing


That would cause a memory leak

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old October 24th, 2006, 10:32 AM
Authorized User
 
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Default

So what do I better do then?
Something like

sql="Select * from TABLE WHERE NAME=XXX"
rs.open sql
//do stuff
rs.Close
Conn.Close
Set rs=Nothing
Set Conn=Nothing

Open again the connection
sql="INSERT INTO table(columns)VALUES(data)
rs.open sql
//do stuff
rs.Close
Conn.Close
Set rs=Nothing
Set Conn=Nothing

Would that help?
Because I just have re-viewed some code of some other pages, where I create new records, AFTER a select...... and that might be the problem why it crashes today so much....

thx
Johny


 
Old October 24th, 2006, 10:36 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Yes you would use the above example but modifiy it slightly:

sql="Select * from TABLE WHERE NAME=XXX"
conn.open
rs.open sql
//do stuff
rs.Close
Conn.Close


Open again the connection
sql="INSERT INTO table(columns)VALUES(data)
conn.open
rs.open sql
//do stuff
rs.Close
Conn.Close
Set rs=Nothing
Set Conn=Nothing

If you call Set rs=Nothing and Set Conn=Nothing after the first call you will have to recreate the objects (rs = Server.CreateObject("ADODB.RecordSet")) before the second call. By only setting them to nothing after the end of the second call you dont have to recreate the objects.

hth.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old October 24th, 2006, 10:45 AM
Authorized User
 
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thx dparsons,

I am going to check all the lines of the new code, because it is driving me crazy re-starting the server every 10 minutes :-)

Thx again for the effort and time!

Greetings,

Johny


 
Old October 24th, 2006, 10:47 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No problem, hope it works out for you =]

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old October 24th, 2006, 10:58 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are using anything but the Jet ole db provider, you might want to switch to using it in your connection string:

Provider=Microsoft.Jet.OLEDB.4.0

The error you are getting is a generic error that can mean a number of things. I think the connections issue that is being discussed is a red herring. I have numerous asp applications that do a great deal of work using a single connection and have never had a problem. As a matter of fact, I have an application that has been in very heavy constant use for about 5 years using an access db and have never had this issue.

Woody Z http://www.learntoprogramnow.com
 
Old October 24th, 2006, 11:05 AM
Authorized User
 
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Dparsons,

I have another question.
How can I then combine two SQL together, while the first one is a select and the second uses some data from the first one. Like this

sql="Select * from table where user='Johny'"
...
sq2="Insert Into Table set newmember='"&rs("nameofsql")&"'"
....

If I close the first one, i can not use the second one.

I do a lot of "DO WHILE NOT rs.EOF" stuff, where I first select some data of a DBF file and then in that one I insert the data into a SQL DB.....

DO WHILE NOT rs.EOF
  ...
 sql2="INSERT INTO..."
  ...
  rs.MOVENEXT
LOOP
any ideas?

Thx







Similar Threads
Thread Thread Starter Forum Replies Last Post
ODBC Drivers error '80004005' sanju2006 Classic ASP Professional 3 August 31st, 2006 09:21 AM
ODBC Drivers error '80040e14' kucker6 Classic ASP Databases 2 June 1st, 2006 01:06 PM
Microsoft OLE DB Provider for ODBC Drivers error ' rajiv_software Classic ASP Basics 6 April 28th, 2005 12:52 AM
ODBC Drivers error '80004005' caudy Classic ASP Databases 2 August 20th, 2004 02:20 AM
ODBC Drivers error '80040e14' Need help RBC827 Classic ASP Databases 6 February 27th, 2004 04:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.