Asp.net fails to connect to access db after a while

  • Thread starter Thread starter mark
  • Start date Start date
M

mark

My asp.net app fails to make any further connections to
my access db after surfing for a while. This error also
brings down the entire site for all other users as well.
Made sure to close all connections and even call dispose
when done. Access lock remains for a while. The file
size of the access db grows from about 500k to 2.5 mb
after browsing the site for a couple of minutes. I'm
using forms authentication with a login script. Never
ran into this problem with the same type of access db
with asp 3.0 web applications. Just recently started
using asp.net. Please help!
 
Did you "close" and "dispose" the "OledbDataReader" and/or "DataAdaptor" in
you behinde code?
Check it first.
 
Yes, I close the datareader. I don't see a dispose method
for the reader though. I really can't see what would be
causing this. Here's a example of how I'm opening and
closing my database:
Public Function getCatname(ByVal catID As String)
Dim myConnection As OleDbConnection = New
OleDbConnection(ConfigurationSettings.AppSettings
("ConnectionString"))
Dim myCommand As OleDbCommand = New
OleDbCommand("qCatName", myConnection)
myCommand.CommandType =
CommandType.StoredProcedure

Dim parameterProductID As OleDbParameter = New
OleDbParameter("catID", OleDbType.VarChar, 50)
parameterProductID.Value = catID
myCommand.Parameters.Add(parameterProductID)

Try
myConnection.Open()
Dim rs As OleDbDataReader =
myCommand.ExecuteReader
Dim catName As String
While rs.Read
catName = rs("CATEGORY")
End While
rs.Close()
Return catName
myCommand.Dispose()
myConnection.Close()
myConnection.Dispose()
myConnection = Nothing
Catch
Return Nothing
End Try
GC.Collect()
End Function

I'm using Access 2000 by the way. Thanks for the info.
 
Back
Top