 |
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
|
|
|

October 24th, 2006, 09:32 AM
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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
|

October 24th, 2006, 09:40 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|

October 24th, 2006, 10:10 AM
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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?
|

October 24th, 2006, 10:22 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|

October 24th, 2006, 10:32 AM
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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
|

October 24th, 2006, 10:36 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|

October 24th, 2006, 10:45 AM
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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
|

October 24th, 2006, 10:47 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|

October 24th, 2006, 10:58 AM
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

October 24th, 2006, 11:05 AM
|
Authorized User
|
|
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |