Darren
Darren

Reputation:

Why do the records get deleted in an access database when I open the file in access?

I'm developing a simple database app in visual studio (c# for Windows) using an access backend.

That's all fine until I try to open the database file from within access, when all the reocords get deleted.

Could anyone explain why this is please?

Upvotes: 0

Views: 256

Answers (3)

David-W-Fenton
David-W-Fenton

Reputation: 23067

This is an old question and I don't know if the original poster is still around, but something that didn't occur to me at the time I originally read the question was that perhaps the C# app is using a transaction to insert the data and is not committing it. If that were the case, the data would be visible in the C# app and would not be there when you opened the file in Access. On the other hand, the data wouldn't be there in a new session of the C# app, either, so this might not be the issue.

Upvotes: 0

Hans Passant
Hans Passant

Reputation: 942010

Did you add the database to your solution? Select it and check the Copy Local (aka Copy to Output Directory) setting in the Properties window. Make sure it isn't set to Copy Always,

Upvotes: 1

Rob3C
Rob3C

Reputation: 456

We need more information. You say that when you open the database from within access, "all the records get deleted". The way the question is phrased implies that some process is running as part of opening the database, e.g., an autoexecute macro. Do you really know that is what is happening? Or are you really just saying that "when I open the database file from access, the records are not there". If the latter, then something is happening along the lines of what cletus suggests.

Upvotes: 0

Related Questions