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

C#-APP: Deleting a database. Restriction Issues

Hi guys.

I have been working on a project for quite a while now, and now i am adding in backup and restore procedures for my program. The issue i have at the moment is that i need to be able to delete the current database file (which the program ONLY reads on certain forms) and then copy in an older/different version.

The problem is that i get the restriction error saying that the file is being used by another process.
I am not actually using any database functions, and the other forms that do have been terminated using this.close().

I need to be able to delete this file. Its only referenced in the code, there isnt any gui type relation between the database and the program.

Any help someone can give me would be appreciated. I have searched this before, but mostly people have actually had the file open, i shouldnt, but im not sure how to totally disconnect the database.

Cheers
Gun Slinger
Jun 24 '08 #1
7 1113
Could someone please give me some advice?

Sorry for bumping.
Jun 25 '08 #2
r035198x
13,262 8TB
Which database are you using?
Are you stopping the database first?
Jun 25 '08 #3
i'm using a .mdf type database.

The question about have i stopped or disconnected from it was sort of the question i was trying to ask.

I am not using any sql statements and shouldnt be reading the database, but the program seems to think otherwise :\
Jun 25 '08 #4
r035198x
13,262 8TB
i'm using a .mdf type database.

The question about have i stopped or disconnected from it was sort of the question i was trying to ask.

I am not using any sql statements and shouldnt be reading the database, but the program seems to think otherwise :\
If the database is running, the file that you are trying to open will be in use by the database itself.
Jun 25 '08 #5
I'm not trying to open the database. I'm trying to delete it so that i can copy in a backed up version of the database.

You have now said that the database will usually run with the program, but how do i ensure that all ties are severed?
Jun 25 '08 #6
r035198x
13,262 8TB
I'm not trying to open the database. I'm trying to delete it so that i can copy in a backed up version of the database.

You have now said that the database will usually run with the program, but how do i ensure that all ties are severed?
Perhaps you need autopilot. Generally you need the database to be stopped (not sure if Access can be stopped and started like other proper DBMSs) before changing it's files.
Jun 25 '08 #7
Sorry that i am not understanding what your saying too well; but what is an autopilot?

I am assuming that its like a dummy version of the database or something along those lines?

Seeing as i only access the database through code and not through the gui options avaliable, i dont see why there is a problem, but there is!
Jun 25 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Jonathan Lamothe | last post by:
I'm helping someone to create an online database. All is fine and good except for one problem. Here it is: In order to provide connectivity to the database, I've created a file called...
1
by: Dave Willock | last post by:
After splitting a database into the standard "Front end" " Back End" set-up the performance on the database has deteriorated to an unusable / unacceptable level - this occured as soon as the...
4
by: Smriti Dev | last post by:
Hi There, I'm creating a MS ACCESS database using Ms Access 2000 to store Interpretation requests by different departments in a hospital and Interpreter availability. All internal departments...
3
by: Materialised | last post by:
Hello everyone, Please bear with me. I have not programmed in Visual Basic since 1994. And now my employer has given me the tedious task of writing a database driven program. I have a access...
1
by: david stradling | last post by:
If I delete records, then add other ones, the new records are entered in place of the old ones. I want the new records to appear last. For example, say I had records number 1 through 5 and...
6
by: mtuller | last post by:
I am having very strange issues today. The scripts that I have, that worked fine on Friday, now do not work properly. I can connect fine with a client application like MySql tools. I can do...
1
by: AirborneBob | last post by:
I created a database (Access '07, MS Office XP Pro) with a front end and a back end. The back end has the data tables and the front end has the forms, queries etc. My friend has been using the...
1
by: psychoduck | last post by:
Hi guys, I am trying to restrict access to my database from multiple users but still allow them to still access the forms, and quersies. I want the users to be able to use a a form that is...
1
by: Callum Farmer | last post by:
Hello, I am trying to delete entries from my database via a website with a button and at the moment it is deleting entries without the click of the button <?php if(isset($_POST)) {...
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.