Microsoft Access
  Home arrow Microsoft Access arrow Page 2 - Upgrading your Access Application for a Mu...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MICROSOFT ACCESS

Upgrading your Access Application for a Multi-user Environment
By: Peter Lavin
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 31
    2004-07-14

    Table of Contents:
  • Upgrading your Access Application for a Multi-user Environment
  • Connection Object
  • Recordset Object
  • Security
  • Performance Improvements

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Upgrading your Access Application for a Multi-user Environment - Connection Object


    (Page 2 of 5 )

    Connection Object

    Let’s start by discussing the connection object and what properties it should have. For a discussion of concurrency the most important feature is the “Mode” in which a database is opened. While Access defaults to opening a database in adModeShareDenyNone – a non-exclusive mode that will allow the user to both read from and write to a database, it does not hurt to make this explicit when opening a connection. (Of course you need not open the database in this mode if it doesn’t make sense for the current user). Find below the code for opening a connection.

    Dim strpassword as String

    Dim struser as String

    Dim strConnect as String

    Dim cnDemo as ADODB.Connection

    ‘assume code to retrieve username and password

    ‘from a dialog box

    Set cnDemo = New ADODB.Connection

    strConnect = “Data Source=” & App.Path & “\dbname.mdb;User ID=” & _

      struser & “;Password=” & strpassword & “;Provider=MSDASQL.1”

    With cnDemo

        .Mode = adModeShareDenyNone

        .ConnectionString = strConnect

        .Properties("JetOLEDB:SystemDatabase")=App.Path & "\Secured.mdw"

        .CursorLocation = adUseServer

        .Open

    End With

    You cannot open a recordset that allows multiple users to change data in the database unless it is opened against a connection that is shared and read/write. Cursor location is also important when opening your connection. When using a server-side cursor changes made by other users are visible. Since the ConnectionString and Properties relate to security, they will be discussed later.

    To summarize, the connection type is most important in the context of concurrency because no issues will arise if the mode is exclusive or if users are not allowed to change data in the database. Additionally, if a recordset is opened against a connection that is opened in the adModeRead mode, then no matter how you open your recordset you will not be able to change data and hence issues of concurrency will not arise.

    More Microsoft Access Articles
    More By Peter Lavin


       · hi,Ok it won't support more on 20 people,but if we want that are steps we need to...
     

    MICROSOFT ACCESS ARTICLES

    - Linking SQL Express 2005 Tables to MS Access...
    - Working with Access Projects in Access 2007
    - Exploring Access 2007
    - Working with Stored Procedures in an MS Acce...
    - Creating and Using Action Queries
    - Creating Data Access Pages with Charts using...
    - Advanced Ideas using VBA
    - VBA Details
    - Updating Records in MS Access
    - Using ADO`s Record Object with URLs
    - Exporting XML from MS Access 2003
    - Importing XML into MS Access 2003
    - On Using Pass-through Queries in MS Access
    - Distributed Queries in MS Access
    - Configuring a Linked Microsoft Access Server...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway