?
Solved

How make concurrent connection to msaccess db in C#

Posted on 2010-04-04
9
Medium Priority
?
773 Views
Last Modified: 2013-11-29
I have msaccess database.
I want it to put it on shared folder and access it in a c# app on network.
There will concurrent user as well.
Please provide some sample code on how to do this.
0
Comment
Question by:Maverick_Cool
9 Comments
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 29733518
You can not use MS Access this way as Access does not support concurrency (multiple users updating information on the same table). For concurrency you need to upgrade to SQL Server
0
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 29734070
I mean if happens one after the other its ok.
DB Read should not fail.
Atleat the connection should be concurrent.
0
 
LVL 71

Expert Comment

by:Éric Moreau
ID: 29775799
check the connections strings from http://www.connectionstrings.com/access
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 7

Author Comment

by:Maverick_Cool
ID: 29777433
but howz that help my question. some explanation plz.
0
 
LVL 3

Expert Comment

by:Tyug
ID: 29802533
Well, if there's only one user accessing your program at a time (because msaccess cannot support multiple users at the same time).
Then there isn't any problem as long as you use the correct connection strings in your program.

read this: http://www.csharphelp.com/2006/01/ms-access-application-with-c/ to get you started.
Then you will understand what emoreau meant by checking the connection string.
0
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 29812847
i understand what you are stressing.
but all i wanted to know is that, i have put .mbd file in shared location.
Now to 2 person try access the db from 2 different machine. i will it throw exception. or 1 will wait for the other.
0
 
LVL 3

Expert Comment

by:Tyug
ID: 29815401
Oh, that depends if you are trying to write/update at the same time. If yes, then you will run into errors (throw exceptions). If you are just reading, then it'll be able to run fine if both users use read only access (specify this in the connection string)
0
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 29815769
" users use read only access (specify this in the connection string)"
please empathize on this
0
 
LVL 3

Accepted Solution

by:
Tyug earned 2000 total points
ID: 29841460
Read this: http://msdn.microsoft.com/en-us/library/aa167840(office.11).aspx for some design hints and

for your connection (this is for vb... but should work for c#) This is the code that allows multiple connection
conn.mode = 16 'adModeShareDenyNone'
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Audit trails are very important in any system to hold people responsible for certain transactions and hold them to take ownership of their actions. This article is dedicated to all novice "Microsoft Access" developers.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question