?
Solved

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

Posted on 2008-06-17
5
Medium Priority
?
251 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

764 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