Board index » delphi » how to minimize active connections

how to minimize active connections

hello world!
i have a problem with the active connections of the sql-server.
i use the SQL-Server Version of the MS Small Business Server. In this
version the active connections are limited to 5. When i have a tTable
connection  to the sql-server that accesses a large sql table, the
connection keeps active. => the application is locked and can only
killed by the task manager because the limit of active connections is
reached.

What can i do that a connection like this becomes inactive while the
table is still open???

 

Re:how to minimize active connections


Quote
>>What can i do that a connection like this becomes inactive while the
>>table is still open???

You might want to create the table using SQL via TQuery:

The TQuery.SQL would be something like this example from SQLREF32.hlp:

CREATE TABLE SALARY_HISTORY
        (EMP_NO EMPNO NOT NULL,
        CHANGE_DATE DATE DEFAULT "NOW" NOT NULL,
        UPDATER_ID VARCHAR(20) NOT NULL,
        OLD_SALARY SALARY NOT NULL,
        PERCENT_CHANGE DOUBLE PRECISION
        DEFAULT 0
        NOT NULL
        CHECK (PERCENT_CHANGE BETWEEN -50 AND 50),
        NEW_SALARY COMPUTED BY
        (OLD_SALARY + OLD_SALARY * PERCENT_CHANGE / 100),
        PRIMARY KEY (EMP_NO, CHANGE_DATE, UPDATER_ID),
        FOREIGN KEY (EMP_NO) REFERENCES EMPLOYEE (EMP_NO));

After the SQL is set, then call TQuery.ExecSQL

=Bill=

Re:how to minimize active connections


Quote
>>What can i do that a connection like this becomes inactive while the
>>table is still open???

Use TQuery instead of TTable

=Bill=

Other Threads