Locks problem using SQL Server 2000

From: JogyRoger (jj_at_jj.com)
Date: 02/22/04


Date: Sun, 22 Feb 2004 18:55:21 +0200


   I have a locking problem when using SQL Server with ADO. I use one
connection to access a specific database, to select data from it and update
insert data in it. The connection's properties are these:
  object Conn: TADOConnection
    CommandTimeout = 2000
    CursorLocation = clUseServer
    IsolationLevel = ilReadUncommitted
    LoginPrompt = False
    Provider = 'SQLOLEDB.1'
  end

    So the problem happens at point of the process where i'm selecting data
from one or two tables , then scroll the dataset and update the data. Here
it is the function that creates dynamically the dataset that i use:
    res := TADODataSet.Create(nil);
    res.CommandTimeout := CmdTimeout;
    res.CursorLocation := clUseServer;
    res.CursorType := ctOpenForwardOnly;

    res.ExecuteOptions := [];
    res.LockType := ltReadOnly;
    res.CacheSize := ADOCacheSize;
    res.Connection := conn; //This is set to Conn
    Result := res;

    and the definition of the command that i use for the updates:
    CommandTimeout = 2000
    Connection = Conn
    ExecuteOptions = [eoExecuteNoRecords]
    Parameters = <>
  So i have the open dataset and when the first update statement executes i
get Timeout expired after a long time (i've set commandtimout to a big
number). If i try to repeat only this procedure again and again the result
is the same even if i close and start the application again. But if i
restart the SQL Server the procedure works without any problems. Any
suggestions what to do? I fixed the same problem for another procedures as i
got all the UPDATES statements in a StringList and posted them after i
closed the dataset which i used to generate them. However in this case there
are too many rows to update and i cannot store all updates in the memory....

    JogyRoger



Relevant Pages

  • Re: Task
    ... A simple UPDATE Statement will do the job ... Pump the data from your connection 2 over to the connection 1. ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ...
    (microsoft.public.sqlserver.dts)
  • Re: Error "SQL Server does not allow remote connections"
    ... The application could not connect to the sql server db. ... network is blocking the connection. ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 ... integratedSecurity, SqlConnection owningObject) +737554 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Connection from remote computer to network SQL Server
    ... There is no firewall on the W2K machine acting as the SQL server. ... I tried making the SQL machine a "trusted" on the router. ... connection works. ... To find the IP address of your computer inside the network, ...
    (microsoft.public.access.adp.sqlserver)
  • ADO.net Orcas Samples Install Problem
    ... An error has occurred while establishing a connection to the server. ... When connecting to SQL Server 2005, this failure may be caused by the ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, ... or am I better off with a full SQL Server install. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: OpenDataSource SQL Server xpress problem
    ... I tried your suggestions with some success. ... I tried setting up the .odc file through the Word Mail Merge wizard as ... If I work through the dialog to connect and then click the 'Test Connection' ... but I suspect it's because until recently most SQL Server ...
    (microsoft.public.word.mailmerge.fields)