473,382 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Please help: Cant get rid of lock on the MS access DB

Joe
Hi,
I have an asp.net page that opens up a connection to MS access DB and does insert into DB. I am using close() and setting the connection object to Nothing after I am done with inserting a record. After inserting when I look at the server where the MS access DB resides I also see a *.ldb file also. For some reason I cannot get rid of this *.ldb file even after I close the connection to DB from my asp.net page. As long as this *.ldb file is there I cannot overwrite /rename/move this MS Access DB. The only way I can get rid of this *.ldb file is by restarting the IIS which is not a good solution.
Can anyone give me an idea if I am doing something wrong or how to get rid of this *.ldb file?
Thanks,
Joe
___
Newsgroups brought to you courtesy of www.dotnetjohn.com
Nov 20 '05 #1
1 2439
Joe,

I have a little program the writes to an access.mdb file from an ASP.NET
page. If it is creating the .ldb file (the lock file), it is happening so
fast I don't even see it.

Here is my code that works. I am not even calling dispose on my connection
object.

Try
cn.Open()
cmd.ExecuteNonQuery()

Catch ex As Exception
ErrorAlert("An error occured saving to database. Please try
again.")
Trace.Warn(ex.ToString)
Return
Finally
cn.Close()
End Try

Are you successfully inserting the record at all? If not, maybe ASPNET user
doesn't have modify rights to the folder the .mdb resides in.

I just tried renaming the .mdb immediately after running my program, and it
let me do it. (no lock by IIS or anything)

Bottom line: while Access on a web server is not a good idea (everybody can
stop typing now!), it should not be behaving the way it is for you...

HTH,
Greg

"Joe" <Jo*@joe.com> wrote in message
news:eD**************@TK2MSFTNGP10.phx.gbl...
Hi,
I have an asp.net page that opens up a connection to MS access DB and does insert into DB. I am using close() and setting the connection object to
Nothing after I am done with inserting a record. After inserting when I look
at the server where the MS access DB resides I also see a *.ldb file also.
For some reason I cannot get rid of this *.ldb file even after I close the
connection to DB from my asp.net page. As long as this *.ldb file is there
I cannot overwrite /rename/move this MS Access DB. The only way I can get
rid of this *.ldb file is by restarting the IIS which is not a good
solution. Can anyone give me an idea if I am doing something wrong or how to get rid of this *.ldb file? Thanks,
Joe
___
Newsgroups brought to you courtesy of www.dotnetjohn.com

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Agnes | last post by:
I got a ASP program in the server, it runs properly . However, As I run the web siste , click 'login' button. It return the following errors. It seems can't connect the database, I had stopped...
12
by: Me | last post by:
Hi, I would like learn from people with experience in C++, which of the following styles of way to construct "get/set" member functions would be the best in terms of usability, speed, et cetera. ...
3
by: Joe Befumo | last post by:
This is my first attempt at multi-thread programming, and I'm encountering a program-logic problem that I can't quite put my finger on. The program is pretty simple. I'm trying to validate a...
1
by: ictheion | last post by:
Hi, I am having a problem utilizing ofstream*'s stored in a map (map<char, ofstream*>). I'm having basically the same problem with a map<char, boost::mutex*>. My code compiles, but at run-time I...
1
by: Willow | last post by:
Hi I hope you can help me with this it is driving me nuts. I've created a database which I needed to give multiple people access to but didn't want them messing so I created an MDE file. I...
30
by: Alf P. Steinbach | last post by:
I once suggested in that SomeOne Else(TM) should propose a string value class that accepted literals and char pointers and so on, with possible custom deleter, and in case of literal strings just...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
5
by: chromis | last post by:
Hi there, I've recently been updating a site to use locking on application level variables, and I am trying to use a commonly used method which copies the application struct into the request...
0
by: LanaR | last post by:
Hello, one sql statement is causing severe performance issue. The problem occurs only in UDB environment, the same statemnt on the mainframe is running fine. I have an explain output from the sql....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.