3

My problem is that I need to use a access database as a backend for my visual basic.net program.

The database will be accessed by a maximum of 10 users but I want to lock tables when a user is updating a record.

I am unable to use the SQL server at the company due to it storing sensitive information.

I have some basic knowledge of ado.net

I have read many articles but I can't find any articles that say how to lock a access .mdb file using Visual basic.net

I am aware that a SQL server is a better option but this is not possible option for me at the moment

4
  • "I am unable to use the SQL server at the company due to it storing sensitive information." That doesn't make any sense to me at all. SQL Server is vastly more secure than Access. MySQL might be a good option for you. Commented Dec 14, 2011 at 0:23
  • I was told by the company that I could not use their SQL server for my program due to the company using it to store sensitive data . My access database will not contain any sensitive data and it will be stored on a different server. Commented Dec 14, 2011 at 0:48
  • No chance of storing another instance of SQL Server on the same box? Commented Dec 15, 2011 at 2:41
  • After further discussion with the company I have been told the computers that will be using my program will not have any access to the SQL server as there is two separate networks. Commented Dec 15, 2011 at 22:56

1 Answer 1

1

I suspect that your best bet is to add a "Locks" table which contains a record for each table in your database and a flag that indicates if the table is locked or not.

The calling methods would be responsible for checking this table prior to executing their code.

Because you will be working with individual records, the Access record locking mechanism should prevent simultaneous updates of a single record in this table, but if you get a lock, you should probably double-check it after obtaining it to ensure that it is valid.

Sign up to request clarification or add additional context in comments.

1 Comment

Is the Access record locking mechanism a automatic action by access or does it require some code to be executed in vb.net? If it is manual in vb.net do you have any example code to show me on how to lock the record?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.