Access2k + SQL 7.0 Lock problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Kyrill Fomichev (kfomichev_at_ikadent.ru)
Date: 10/28/04


Date: Thu, 28 Oct 2004 11:45:07 +0400

Hi.

I have an Access database (mdb) which has tables linked to SQL Server 7.0
via ODBC.
Among others there are three tables:
Clients (Stores info on all clients)
Persons (Stores names of contact persons in each client company, is joint
with Clients table)
Events (Stores info on telephone calls, meetings etc. with each Clent, is
joint with Clients table. It has info about when and which of our managers
made the contact, is the contact complete or planned, contact description,
the person of client company to contact )

I need to display a summary table which contains info on each client: when
and who of the employees made contacts with the client, who was the client's
contact person, thÕ contact description, and if there is a subsequent
contact planned - the same info on the planned contact. One single row for
each client.
First I made a set of nested queries in Access. This worked reliably but
slow.
Then I decided to write a view (with a subquery set) on SQL Server and
linked it as a table in Access. Now it works very quickly, but I got a great
problem:
Each time the summary table is opened in Access SQL Server places a great
number of locks on the Events table index pages. This prevents other users
from editing Events records while the first user looks at the summary table.
The form that displays the summary table has RecordsetType property set to
Static and RecordLocks property set to No Locks. The user has only "Select"
permission to the view set on server. It also doesn't matter how is this
view opened: as linked Access table, as Access SQL pass-through query or as
a view in Enterprise Manager.
The view source SQL is below (if this helps).

Dou yoy have any suggestions?

Best regards,
Kyrll.

CREATE VIEW dbo.Summary
AS
SELECT SummaryMaxDate.ManagerKey, Clients.ClientKey,
    Clients.RusName, Events.EventDate AS Date1,
    Events.Description AS Desc1, Persons.PName AS Name1,
    Events_1.EventDate AS Date2,
    Events_1.Description AS Desc2, Persons.PName AS Name2
FROM (SELECT Events.ClientKey, Events.ManagerKey
      FROM Events
      WHERE (((Events.ClientStatusKey) < 30))
      GROUP BY Events.ClientKey, Events.ManagerKey)
    SummaryMaxDate INNER JOIN
    Clients ON
    SummaryMaxDate.ClientKey = Clients.ClientKey LEFT OUTER JOIN
        (SELECT Events.ClientKey, Events.ManagerKey,
           MIN(Events.EventDate) AS [Min-EventDate]
      FROM Events
      WHERE (((Events.ClientStatusKey) < 30) AND
           ((Events.EventStatusKey) = 10))
      GROUP BY Events.ClientKey, Events.ManagerKey)
    SummaryMinPlanDate ON
    SummaryMaxDate.ClientKey = SummaryMinPlanDate.ClientKey AND
     SummaryMaxDate.ManagerKey = SummaryMinPlanDate.ManagerKey
     LEFT OUTER JOIN
        (SELECT Events.ClientKey, Events.ManagerKey,
           MAX(Events.EventDate) AS [Max-EventDate]
      FROM Events
      WHERE (((Events.ClientStatusKey) < 30) AND
           ((Events.EventStatusKey) = 20))
      GROUP BY Events.ClientKey, Events.ManagerKey)
    SummaryMaxCompleteDate ON
    SummaryMaxDate.ClientKey = SummaryMaxCompleteDate.ClientKey
     AND
    SummaryMaxDate.ManagerKey = SummaryMaxCompleteDate.ManagerKey
     LEFT OUTER JOIN
    Events ON
    SummaryMaxCompleteDate.ClientKey = Events.ClientKey AND
    SummaryMaxCompleteDate.ManagerKey = Events.ManagerKey AND
     SummaryMaxCompleteDate.[Max-EventDate] = Events.EventDate
     LEFT OUTER JOIN
    Events Events_1 ON
    SummaryMinPlanDate.ClientKey = Events_1.ClientKey AND
    SummaryMinPlanDate.ManagerKey = Events_1.ManagerKey AND
     SummaryMinPlanDate.[Min-EventDate] = Events_1.EventDate LEFT
     OUTER JOIN
    Persons ON
    Events.PersonKey = Persons.PersonKey LEFT OUTER JOIN
    Persons Persons_1 ON
    Events_1.PersonKey = Persons_1.PersonKey



Relevant Pages

  • C++ and Dot Net Jobs
    ... Please find the list of Active jobs with our Clients. ... Strong object-oriented analysis and design skills and experience. ... Experience developing applications under the Windows.NET framework ... Experience developing applications using SQL Server 2000. ...
    (comp.lang.cpp)
  • Re: MS Access Reports and VB.NET Program
    ... think that I want to ship a 30mb .NET framework to each of my clients? ... Barns & Noble has some books that could help you learn .NET. ... It is Access TIMES eCommerce TIMES Sql Server. ... that you actually posted how to execute the report using a macro. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... connections need to be returned to the pool to be ... Enterprise version of SQL Server 2000. ... server user login to be sure that it is not mixed with other running clients). ... Every new client opens again 30 connections if I open 30 tables ...
    (microsoft.public.sqlserver.connect)
  • Re: Application Security
    ... these Windows Forms applications, ASP.NET applications, Windows services, or ... I assume that your C# clients are not distributed to end users. ... > There is a global SQL Server userid and password. ...
    (microsoft.public.dotnet.security)
  • Re: SQL Server 2005 Licensing concern.
    ... In all the years of building SQL Server solutions for our clients, ... Your clients can buy whatever version their workload allows, ... I am aware that we can purchase the Developer ... The developer edition is the same as the Enterprise edition. ...
    (comp.databases.ms-sqlserver)