Click to See Complete Forum and Search --> : Can't access to DB after editing it..
gricceri
August 7th, 2000, 12:41 PM
After any editng query like UPDATE, INSERT and DELETE to the DB, I get a '80004005' error if I access to the DB. I think that is due to resources (the DB) releasing problem. In fact, If I put a Session.abandon at the end of my code, things work fine, but I loose my session variables. What can I do?
ang@dy4.com
August 9th, 2000, 08:57 AM
Before you do a session.abandon, write out your variable to a cookie (if it's not too confidential). I don't see any reason why your DB is giving you error. Did you close your ODBC (I assume you're using that) properly?
dougseven
August 10th, 2000, 04:53 AM
gricceri
August 10th, 2000, 08:56 AM
MS Access.
P.S.: I get that error even if I close all connections at the end of the script.
Rick Leinecker
August 10th, 2000, 06:03 PM
I'd try three things.
1. Besides closing as follows:
rs.Close
cn.Close
Set the objects to nothing to release any and all resources as follows:
rs.Close
Set rs = nothing
cn.Close
Set cn = nothing
2. Make sure you've installed the latest version of MDAC on the server.
3. Bump the number of allowed connections. The default value in IIS4 is kind of low, the default value in IIS5 is unlimited.
If you're still having problems, can you email me some simplified code that gives the problem? I'll look into it.
dougseven
August 11th, 2000, 01:30 AM
This is an MS Access issue. Access caches pages (groups of records), and doesn't let go for any where from 0 seconds to 2 minutes. Off the top of my head I can't remember what to do to get around it, but I will look into it.
I know this doesn't help, but I feel obligated to say it. Access is just not meant for web applications. While I was working in Dev Support at Microsoft, this was something we would run into to quite a bit. It is an Access architecture thing.
I'll let you know what I can find out. Can you post, or email me directly, the code you are using to interact with the database?
Thanks,
Doug Seven
CodeJunkies.Net / ASPNextGen.com
doug.seven@codejunkies.net
______________________________________
Doug Seven, MCSD
CodeJunkies.Net / ASPNextGen.com
doug.seven@codejunkies.net
Two new sites are coming, dedicated exclusively to ASP+. Stay tuned for www.ASPNextGen.com and www.theFutureOfASP.com, both brought to you exclusively by CodeJunkies.Net. Tentative launch - August 16, 2000
http://www.codejunkies.net
"Between two evils, I always choose the one I haven't tried."
--Mae West
SyphonTHOMAS
August 13th, 2000, 08:45 AM
After ADDING or DELETING records you hawe to use UPDATE function for recordset.
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = 5
DataConn.CommandTimeout = 5
DataConn.Open "DBQ=" & Server.MapPath ("/databases")+"/users.mdb" & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=128;Threads=21;", "username", "password"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConn
if order"date" then cmdDC.CommandText = "SELECT * FROM users ;"
cmdDC.CommandType = 1
Set rsDC = Server.CreateObject("ADODB.Recordset")
rsDC.Open cmdDC, , 2, 2
rsDC.AddNew
rsDC.fields("user")="John"
rsDC.fields("age")=20
rsDC.update ' <---- UPDATING RECORDSET
'After updating you can close
rsDC.Close
Set rsDC = Nothing
Set cmdDC = Nothing
DataConn.Close
Set DataConn = Nothing
SyphonTHOMAS
August 13th, 2000, 08:48 AM
After ADDING or DELETING records you hawe to use UPDATE function for recordset
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = 5
DataConn.CommandTimeout = 5
DataConn.Open "DBQ=" & Server.MapPath ("/databases")+"/users.mdb" & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=128;Threads=21;", "username", "password"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConn
if order"date" then cmdDC.CommandText = "SELECT * FROM users ;"
cmdDC.CommandType = 1
Set rsDC = Server.CreateObject("ADODB.Recordset")
rsDC.Open cmdDC, , 2, 2
rsDC.AddNew
rsDC.fields("user")="John"
rsDC.fields("age")=20
rsDC.update ' <---- UPDATING RECORDSET
'After updating you can close
rsDC.Close
Set rsDC = Nothing
Set cmdDC = Nothing
DataConn.Close
Set DataConn = Nothing
chrisveale
May 1st, 2006, 11:47 PM
hi All.
Sorry for resurrecting this thread again....I see its quite old, but havent been able to find a resolution to the issue still :(
I am accessing a microsoft access database using the following commands
'Holds the connection details for the Database.
dim ConnStr
ConnStr = "Data Source=" & "db.mdb" & ";Provider=Microsoft.Jet.OLEDB.4.0;"
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.ConnectionTimeout=5
adoCon.CommandTimeout=5
adoCon.Mode=3
adoCon.Open ConnStr
Then I do stuff with recordsets and the like...
dim rSUpdate
set rSUpdate = adoCon.Execute(sqlqry)
Finally I close the recordsets and the db connection (or so I thought) with the following commands
'free the memory from the DB connections
set rSUpdate = nothing
adoCon.Close
Set adoCon = Nothing
But I have the same problem as above where the db connection doesnt seem to be relinquished and if I do anything else with the DB the connection at the start of the page fails as its already open....
Please can someone help me with this? I believe its an access issue?
Cheers
Chris
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.