473,657 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

database file locked by aspx

I ued this code to connect to a mdb file


A = New OleDbConnection ( "PROVIDER=Micro soft.Jet.OLEDB. 4.0;DATA
Source=C:\Inetp ub\wwwroot\ASPX \Authors.mdb" )

However, I found the Access Mdb file is locked and cannot be edited by
Access even I have closed the connection using

A.Close()

The file is simply locked.

How to avoid this problem and how to fix it ??


Nov 19 '05 #1
4 2761
Do you have the access database open in it's own window while trying to run
against it?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"hkappleora nge" <hk***********@ yahoo.com.hk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I ued this code to connect to a mdb file


A = New OleDbConnection ( "PROVIDER=Micro soft.Jet.OLEDB. 4.0;DATA
Source=C:\Inetp ub\wwwroot\ASPX \Authors.mdb" )

However, I found the Access Mdb file is locked and cannot be edited by
Access even I have closed the connection using

A.Close()

The file is simply locked.

How to avoid this problem and how to fix it ??

Nov 19 '05 #2
Thanks for replying. I have already closed the Access when I run the aspx
file. After running this aspx file, I found I cannot open the mdb file using
Access. I cannot access even I closed all IE windows... help ....

Is there something I should do in the code to avoid this problem ??

Many thanks.

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> ¼¶¼g©ó¶l¥ó·s»D: O5************* *@TK2MSFTNGP15. phx.gbl...
Do you have the access database open in it's own window while trying to
run against it?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"hkappleora nge" <hk***********@ yahoo.com.hk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I ued this code to connect to a mdb file


A = New OleDbConnection ( "PROVIDER=Micro soft.Jet.OLEDB. 4.0;DATA
Source=C:\Inetp ub\wwwroot\ASPX \Authors.mdb" )

However, I found the Access Mdb file is locked and cannot be edited by
Access even I have closed the connection using

A.Close()

The file is simply locked.

How to avoid this problem and how to fix it ??


Nov 19 '05 #3
Ok,

And is this happening after you get data out of the database the first time?

If, for example, you access your data via a datareader you have to close
the datareader afterward. Also, if an error occurrs while the datareader is
open you need to make certain to use a try catch finally structure and close
the reader in the finally section in order to make certain that it closes
properly each time.

E.g.

Try
'---Open data reader and do some things with the data (while the
datareader is open the database is locked)
Catch ex As Exception
'---Handle any exceptions that may occurr
Finally
'---Close the data reader so that the database is no longer locked
End Try

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"hkappleora nge" <hk***********@ yahoo.com.hk> wrote in message
news:uy******** ******@TK2MSFTN GP09.phx.gbl...
Thanks for replying. I have already closed the Access when I run the aspx
file. After running this aspx file, I found I cannot open the mdb file
using Access. I cannot access even I closed all IE windows... help ....

Is there something I should do in the code to avoid this problem ??

Many thanks.

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com>
¼¶¼g©ó¶l¥ó·s»D: O5************* *@TK2MSFTNGP15. phx.gbl...
Do you have the access database open in it's own window while trying to
run against it?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"hkappleora nge" <hk***********@ yahoo.com.hk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I ued this code to connect to a mdb file


A = New OleDbConnection ( "PROVIDER=Micro soft.Jet.OLEDB. 4.0;DATA
Source=C:\Inetp ub\wwwroot\ASPX \Authors.mdb" )

However, I found the Access Mdb file is locked and cannot be edited by
Access even I have closed the connection using

A.Close()

The file is simply locked.

How to avoid this problem and how to fix it ??



Nov 19 '05 #4
when using Access, I create a folder, called Data, and put the db in
there. I then set modify permissions on the whole folder

access creates a lock file, which goes in this folder. you want modify
permissions on this file, but it doesn't exist til access is run.

either way, doing this allows you to have access open while asp.net is
using it.

you might have to restart your asp.net worker process to unlock the
file.

thx

Nov 19 '05 #5

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

Similar topics

9
1580
by: J. Frank Parnell | last post by:
hello, i dont know asp at all, but i have been asked to backup a database that is used on a site which uses .aspx. i dont need to do anything with it, just copy it and send it along to someone who will. I have the IP, username, password. i have allready got all the files off the site with ftp, is the database in there? i dont really even know what i'm looking for, but i dont see any .mdb or .sql right off the bat.
1
2641
by: leon | last post by:
Hi all, I have an .mdb file (access database) which has been set to table level locking (i.e. not just records in question, but the whole table). The database is also in sharing mode (ie. not exclusive)... here is my problem: i have an application that accesses the aforementioned database from Jet ODBC driver and runs a query which implicitly locks the whole table -
2
2250
by: Glenn Venzke | last post by:
I'm trying to put together a web form that lists all current session information. The session info is stored in SQL server database (ASPState) and I'm trying to retreive and display using a SQLDataReader. I seem to have no trouble querying the "ASPStateTempSessions" table but when I try to write it to the page, I throw an exception that basically says that there is no data to display. Is there some special method you must use when performing...
0
1361
by: Tommy B | last post by:
I'm currently working on a casino script for an IRC bot. I was going to make a flat file database, but I decided to make it sqlite after some suggestions. I'm using pysqlite. http://pastebin.com/764315 < Source. The lines that have @@ (pastebin doesn't like me) in front of them are important. ERROR 2006-06-06T22:20:34 Uncaught exception in . Traceback (most recent call last): File "G:\Python24\Lib\site-packages\supybot\callbacks.py",...
5
14426
by: Glen Buell | last post by:
Hi all, I have a major problem with my ASP.NET website and it's SQL Server 2005 Express database, and I'm wondering if anyone could help me out with it. This site is on a webhost (WebHost4Life) and was running fine and dandy, until I decided I needed to add some additional stored procedures to the database.
3
2084
by: ksarkies | last post by:
Hi This is a "problem" I've been battling for many days and haven't been able to understand; various postings I've come across on the Internet seem to not quite provide the answer. We have a commercial (membership database) application written around Access 2002 and we are using Access 2003 to run it on Server 2003 (64 bit), and 32 bit XP Pro. The database file is locked in some way so that it can't be opened within Access, even when using...
9
7804
by: dpatel75 | last post by:
I am trying to copy a database from a SQL 2000 SP3 Windows 2000 server to a 2005 SP2 Windows 2003 server. I am trying to use detach and attach method (have tried both within Management Studio and T-SQL) and experience an error when attaching to the 2005 server: "CREATE FILE encountered operating system error 5 (error not found) while attempting to open or create the physical file 'xxxxxxxxxxxx' (Microsoft SQL Server, Error: 5123)" I have...
0
4427
by: dot.yet | last post by:
Hi Everyone, environment: DB2 9.5 WSE with FP 2a Solaris 10 u5 - 64-bit SMP - 2 Quad CPUS - total 8 cores 16 GB RAM SAMPLE database Solaris Containers
5
3047
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a .Net web service that converts the MODCA files to tif or png file format. This web service runs on a 2003 server. This web service first copies the MODCA file to be converted to a temporary conversion folder. Then it converts it to the desired file format and copies the file to the output folder specified. Then it deletes the converted file from the temporary conversion folder. Then it attempts to delete the copied input file...
0
8411
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
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
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...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7351
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
5638
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
4173
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
2740
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
1732
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.