473,385 Members | 1,919 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,385 software developers and data experts.

database file locked by aspx

I ued this code to connect to a mdb file


A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
Source=C:\Inetpub\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 2751
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
"hkappleorange" <hk***********@yahoo.com.hk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I ued this code to connect to a mdb file


A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
Source=C:\Inetpub\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.g bl...
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
"hkappleorange" <hk***********@yahoo.com.hk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I ued this code to connect to a mdb file


A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
Source=C:\Inetpub\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
"hkappleorange" <hk***********@yahoo.com.hk> wrote in message
news:uy**************@TK2MSFTNGP09.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.g bl...
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
"hkappleorange" <hk***********@yahoo.com.hk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I ued this code to connect to a mdb file


A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
Source=C:\Inetpub\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
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...
1
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...
2
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...
0
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. ...
5
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...
3
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...
9
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...
0
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
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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,...
0
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...

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.