473,326 Members | 2,099 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,326 software developers and data experts.

db connection

I wrote a program in c# and oledb for my access database. After each run i
see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I think I
might have missed something.

Thanks

Aaron
Jul 21 '05 #1
7 1372
My guess, since you didn't show us any code, is that what you are seeing is
connection pooling, add "OLE DB Services=-4" to the connection string to
disable it and see if its that...'tis better to leave it on though when in
production.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Aaron" <ku*****@yahoo.com> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
I wrote a program in c# and oledb for my access database. After each run i
see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I think I might have missed something.

Thanks

Aaron

Jul 21 '05 #2
I am not sure that just because there is *.ldb file still in your folder
doesn't mean Access didn't close properly.

BTW, is this a webapp or winform?

Greg
"Aaron" <ku*****@yahoo.com> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
I wrote a program in c# and oledb for my access database. After each run i
see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I think I
might have missed something.

Thanks

Aaron

Jul 21 '05 #3
It's a webapp. The reason I know this is because when I tried to access the
same db from another server(B) it tells me that the db is locked but it's
already closed on the other server(A).
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:eq**************@TK2MSFTNGP14.phx.gbl...
I am not sure that just because there is *.ldb file still in your folder
doesn't mean Access didn't close properly.

BTW, is this a webapp or winform?

Greg
"Aaron" <ku*****@yahoo.com> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
I wrote a program in c# and oledb for my access database. After each run i
see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I think
I might have missed something.

Thanks

Aaron


Jul 21 '05 #4
Since it is a webapp then there could be something else going on. Make sure
the ASPNET user has read/write rights to the FOLDER that the Access *.mdb
file is sitting in. It needs read/write rights to the folder in order to
properly create (and update) the *.ldb file.

Greg

"Aaron" <ku*****@yahoo.com> wrote in message
news:um**************@tk2msftngp13.phx.gbl...
It's a webapp. The reason I know this is because when I tried to access
the same db from another server(B) it tells me that the db is locked but
it's already closed on the other server(A).
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:eq**************@TK2MSFTNGP14.phx.gbl...
I am not sure that just because there is *.ldb file still in your folder
doesn't mean Access didn't close properly.

BTW, is this a webapp or winform?

Greg
"Aaron" <ku*****@yahoo.com> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
I wrote a program in c# and oledb for my access database. After each run
i see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I think
I might have missed something.

Thanks

Aaron



Jul 21 '05 #5
All the permission is correct. I still think there's a db connection left
open in my code somewhere. What is the best way to locate it?

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:ua**************@TK2MSFTNGP14.phx.gbl...
Since it is a webapp then there could be something else going on. Make
sure the ASPNET user has read/write rights to the FOLDER that the Access
*.mdb file is sitting in. It needs read/write rights to the folder in
order to properly create (and update) the *.ldb file.

Greg

"Aaron" <ku*****@yahoo.com> wrote in message
news:um**************@tk2msftngp13.phx.gbl...
It's a webapp. The reason I know this is because when I tried to access
the same db from another server(B) it tells me that the db is locked but
it's already closed on the other server(A).
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:eq**************@TK2MSFTNGP14.phx.gbl...
I am not sure that just because there is *.ldb file still in your folder
doesn't mean Access didn't close properly.

BTW, is this a webapp or winform?

Greg
"Aaron" <ku*****@yahoo.com> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
I wrote a program in c# and oledb for my access database. After each run
i see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I
think I might have missed something.

Thanks

Aaron



Jul 21 '05 #6
I used to have this problem all the time when I was using Access and Cold
Fusion. I don't know if the same solution will work for you but it's worth a
try.

What we used to do to unlock it is send a bad query like Select * from
non-existent table.

Of course, if the database is on a live server and being used then the
unlocked state would not last long. Since Access is file-based, it locks it
while it's in use. It's just the way it works.

Let us know if it works,

Frank
"Aaron" <ku*****@yahoo.com> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
I wrote a program in c# and oledb for my access database. After each run i
see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I think I might have missed something.

Thanks

Aaron

Jul 21 '05 #7
Aaron,

Mostly when I have seen your question was the problem that was used a
static(C#)/shared(VBNet) class for the connection, is that what you are
doing as well?

Cor.
"Aaron" <ku*****@yahoo.com> schreef in bericht
news:O7**************@TK2MSFTNGP14.phx.gbl...
I wrote a program in c# and oledb for my access database. After each run i
see there's a locked db file in my database folder, it means that my
connection is not closed properly. I did check my code everything seemed
fine. Is there a script or a program that can help me check this? I think I might have missed something.

Thanks

Aaron

Jul 21 '05 #8

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

Similar topics

3
by: G-Fit | last post by:
Hello group, I have several servers hosting SQL databases. On each of them, I have several databases. All those databases have the same structure (even those on different servers), only the data...
11
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a...
6
by: Chris Szabo | last post by:
I've created a data access layer for a .NET web application. I'm using C# and framework 1.1. I'm getting an error from time to time when I close a connection saying: ...
18
by: Rob Nicholson | last post by:
We're getting an occasional occurrence of the following error when two users try and open the same record in our ASP.NET app: "There is already an open DataReader associated with this Connection...
35
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.