Lost connection using tmstable

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rogerbundy
Posts: 3
Joined: Thu 11 Nov 2004 08:40

Lost connection using tmstable

Post by rogerbundy » Tue 04 Jan 2005 18:22

I have a TMSTable that I modify the SQL command before opening (Active := True) to get a subset of records (3500 records) I need to update or delete. When I try to update all the records one at a time (using the table.edit/post and/or table.delete), after about 400 records being updated or deleted, I lose the connection to SQL Server (Message [DBNETLIB][ConnectionOpen(Connect())] SQL Server does not exist or access denied). I see in DBMonitor that it is issuing the DELETE and/or UPDATE statement, but it seems to fail when it gets over 400 to 500 updates... (I am reading 3500 records with one SQL statement modifying the table.SQL command, then editing and/or deleting them based upon individual content).

Any help would be appreciated.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Re: Lost connection using tmstable

Post by Ikar » Wed 05 Jan 2005 07:27

May be you use FetchAll = False?

rogerbundy
Posts: 3
Joined: Thu 11 Nov 2004 08:40

Post by rogerbundy » Wed 05 Jan 2005 15:43

I did have fetchall=false on the two tables involved. I switched them to fetchall=true, and it still fails after about 500 deletes.
Other thoughts?

More.. I pulled the code into a separate project and manually ran it. It worked.
I checked the Profiler for SQL and in my new project, I saw the DELETE/INSERT statements, but in my original program, I saw that before each DELETE/INSERT, a SET NO_BROWSETABLE ON statement is being executed. This statement was not executing in the new project. I compared the connection and table components between the two, but they are the same...

Thoughts???

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 06 Jan 2005 10:31

Probably there are left some queries with in the FetchAll = False original program.

> SET NO_BROWSETABLE ON

This command is added by OLE DB automatically.

Post Reply