Solved

Connecting Access table to read/ create/delete table using .NET in multi user environment

Posted on 2008-06-17
5
249 Views
Last Modified: 2008-07-17
I am connecting to acces table  to read some info from tbl_Test and will fill the dataset using command object.

I have few concern on this method...

1) The .NET will be used by multiple user so what will be the  best approach i should follow to avoid the common issues like he Microsoft Jet Database Engine cannot open the file ''\\svrPDM\master.mdb". It is opened in exclusive mode by another users. I do have some function which will
create and delete tables in master.mdb  

2) Client user network domain account will not have privileges to access the master.mdb file as it is parked in secured server, what i best way i can code the domain username
and password while perform reading, creating,deleting tables.  If possible ,how do i code in the connection string

Please share your thoughts.


       Dim conn As New OleDb.OleDbConnection
        Dim cmd As New OleDb.OleDbCommand
        Dim oleDBAdapter As New OleDb.OleDbDataAdapter
        Dim dsData As New DataSet
     
       conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data     Source=\\svrPDM\master.mdb;Mode=read;", "test", "1111")
        cmd.Connection = conn
        cmd.CommandText = "SELECT * FROM tbl_Test"
        oleDBAdapter.SelectCommand = cmd
        oleDBAdapter.Fill(dsData)
===========================================================================

0
Comment
Question by:nyeesg1984
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 24

Expert Comment

by:Jeff Certain
ID: 21811842
You may want to consider using something other than Access as your backend database.

If cost is a concern, SQL Server Express may be worth considering.

You can also force Access to open in non-exclusive mode, but specifying "Exclusive = 0" as part of the JET engine connection string.
0
 

Author Comment

by:nyeesg1984
ID: 21818668
Hi,

I  have no choice, have to use access 2000.

How do i connect to the access database using domain user name and password. , default windows login domain act doesnt have the privileges to  access the mdb, in other words i need to code this username/password along with connection string.


0
 
LVL 24

Accepted Solution

by:
Jeff Certain earned 500 total points
ID: 21818765
Set the connection string to
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword;Exclusive=0;

More options here: http://www.connectionstrings.com/?carrier=access
0
 

Author Comment

by:nyeesg1984
ID: 21819781
Not sure whether writen down my question correctly.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword;Exclusive=0;

Assume MyDbPassword is the password for mdb file.

How do i add domain username/password to access mdb file.
0
 
LVL 24

Expert Comment

by:Jeff Certain
ID: 21821117
Okay... so you need to impersonate another domain account.

Here's a lionk that explains how using Windows API calls. Not sure if there's a better way in .NET.
http://www.codeproject.com/KB/cs/User_Impersonation_in_Ne.aspx
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 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