473,792 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2459
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.ExecuteNonQ uery()

Catch ex As Exception
ErrorAlert("An error occured saving to database. Please try
again.")
Trace.Warn(ex.T oString)
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******** ******@TK2MSFTN GP10.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
2884
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 the IIS and run it again, (it still didn't work) , I use visual foxpro to check the database, everything is fine. Please help ~~ Technical Information (for support personnel)
12
5758
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. The following class with be used as an example: class MyClass { public: // member function would go here. private: int data_;
3
1474
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 large list of email addresses. Since the actual validation can take some time, I'm spawning new threads, up to a predetermined maximum value, to process each new address.
1
2405
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 get an Access Violation. Here is some of the code w/ comments as to what isn't working... void cpApp::write_to_file(string w){ char first = *w.begin(); map<char, ofstream*>::iterator i = stream_map.find(first); map<char,...
1
5092
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 ensured that the MDB file was set to shared, not compacting and set to run users not owners permissions before I converted.
30
2475
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 carrying the original pointer. In other words, for the simplest usage code: * no overhead (just carrying a pointer or two), and * no possibility of exceptions (for that case).
4
4531
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 child apps of an IIS application and can be used by multiple users during the application life cycle and for multiple page loads for the same or different page under a root application. What I don't understand and need to know is whether that...
5
6135
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 scope. Application variables are then accessed in this manner Request.App.<Var>. To begin with I had a simple functioning login system inside a subdirectory named admin, this subdirectory had it's own application.cfm, I wasn't sure whether to duplicate...
0
2780
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. The statement itself is not that complicated, it is 3 selects and union all. Explain output is pretty big, but I could not find anything unusual. I'm new to db2 and I could be missing stuff. I am posting the explain output below and I really...
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10159
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.