M
mark
I have a asp.net web application that uses an access 2000
database on the backend. I've been programming asp 3.0
apps with access for a couple of years know and haven't
run into this problem before. I'm using forms
authentication with a login page. After login a .ldb lock
is put on the database and after browsing for a few
minutes the size of the access db grows from about 500k to
2.5 mb. After browsing the site for about 10 minutes the
asp.net script fails to make any further connections to
the access db. This isn't related to a specific spot that
would point to a code problem. I went back and made sure
I close all connections and readers and even
called .dispose on all connections. When this problem
occurs it brings down the entire site for all other users
trying to access over the web. I upload a fresh
web.config file to reset the site and it's good for
another 10 minutes before the same thing happens again.
sample data access code:
Dim myConnection As OleDbConnection = New
OleDbConnection(ConfigurationSettings.AppSettings
("ConnectionString"))
Dim myCommand As OleDbCommand = New
OleDbCommand("qProductInfo", myConnection)
myCommand.CommandType =
CommandType.StoredProcedure
Dim parameterProductID As OleDbParameter = New
OleDbParameter("ProductID", OleDbType.VarChar, 50)
parameterProductID.Value = productID
myCommand.Parameters.Add(parameterProductID)
Dim Item As String
Dim Description As String
Dim ImageH As String
Dim ImageW As String
Dim Min As Integer
Dim CMin_Ok As Boolean
Dim Instock As Boolean
Try
myConnection.Open()
Dim rs As OleDbDataReader =
myCommand.ExecuteReader
Dim myProductDetails As ProductDetails =
New ProductDetails()
While rs.Read
myProductDetails.Item = Replace(rs
("ITEM"), "^", "'")
myProductDetails.Description = Replace
(rs("DESCRIPTION"), "^", "'")
myProductDetails.ImageH = rs("H")
myProductDetails.ImageW = rs("W")
myProductDetails.Instock = rs
("INSTOCK")
myProductDetails.Min = rs("MIN")
myProductDetails.CMin_Ok = rs("CMIN")
End While
Return myProductDetails
rs.Close()
myCommand.Dispose()
myConnection.Close()
myConnection.Dispose()
myConnection = Nothing
Catch
Return Nothing
End Try
GC.Collect()
database on the backend. I've been programming asp 3.0
apps with access for a couple of years know and haven't
run into this problem before. I'm using forms
authentication with a login page. After login a .ldb lock
is put on the database and after browsing for a few
minutes the size of the access db grows from about 500k to
2.5 mb. After browsing the site for about 10 minutes the
asp.net script fails to make any further connections to
the access db. This isn't related to a specific spot that
would point to a code problem. I went back and made sure
I close all connections and readers and even
called .dispose on all connections. When this problem
occurs it brings down the entire site for all other users
trying to access over the web. I upload a fresh
web.config file to reset the site and it's good for
another 10 minutes before the same thing happens again.
sample data access code:
Dim myConnection As OleDbConnection = New
OleDbConnection(ConfigurationSettings.AppSettings
("ConnectionString"))
Dim myCommand As OleDbCommand = New
OleDbCommand("qProductInfo", myConnection)
myCommand.CommandType =
CommandType.StoredProcedure
Dim parameterProductID As OleDbParameter = New
OleDbParameter("ProductID", OleDbType.VarChar, 50)
parameterProductID.Value = productID
myCommand.Parameters.Add(parameterProductID)
Dim Item As String
Dim Description As String
Dim ImageH As String
Dim ImageW As String
Dim Min As Integer
Dim CMin_Ok As Boolean
Dim Instock As Boolean
Try
myConnection.Open()
Dim rs As OleDbDataReader =
myCommand.ExecuteReader
Dim myProductDetails As ProductDetails =
New ProductDetails()
While rs.Read
myProductDetails.Item = Replace(rs
("ITEM"), "^", "'")
myProductDetails.Description = Replace
(rs("DESCRIPTION"), "^", "'")
myProductDetails.ImageH = rs("H")
myProductDetails.ImageW = rs("W")
myProductDetails.Instock = rs
("INSTOCK")
myProductDetails.Min = rs("MIN")
myProductDetails.CMin_Ok = rs("CMIN")
End While
Return myProductDetails
rs.Close()
myCommand.Dispose()
myConnection.Close()
myConnection.Dispose()
myConnection = Nothing
Catch
Return Nothing
End Try
GC.Collect()