Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2002
    Posts
    60

    Unanswered: Allow only one individual at a time

    Using Access2k VBA, is there a way to limit the number of people who are accessing a backend db from their frontend db to one individual at a time? I don't want to setup Access security.

    Any ideas?
    Matt Alexander
    mattalexx@softhome.net

    Don't click here.

    Odigo: 5408962
    AIM: mattalexx
    ICQ: 138006220

  2. #2
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    32
    If only one user should access the database you have to open it in exclusive mode.

    In VBA for Access 2000 you can use ADO or DAO 3.6.

    With ADO use the Connection object and set the Mode property to adModeShareExclusive. (Example freely adapted from Access help.)
    Code:
    Dim cnnDB As ADODB.Connection
    Dim strDataSource As String
    strDataSource = "..."   ' depends on the backend database
    
    Set cnnBackend = New ADODB.Connection
    cnnBackend.Mode = adModeShareExclusive
    cnnBackend.Open strDataSource
    With DAO use the OpenDatabase method with the following syntax:
    Code:
    Set database = workspace.OpenDatabase (dbname, options, read-only, connect)
    Set TRUE for options and the database opens in exclusive mode.

    peter

  3. #3
    Join Date
    Feb 2002
    Posts
    60
    If I used DAO to open a datasource, Would I have to convert the entire form to DAO controls and abandon my Access bound controls?
    Matt Alexander
    mattalexx@softhome.net

    Don't click here.

    Odigo: 5408962
    AIM: mattalexx
    ICQ: 138006220

  4. #4
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    32
    There is no need to change anything in your forms. You use DAO for data access only.

    peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •