Discussion Locked

why the SELECT statement hangs?

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i'm using VB6 and SQL Server 7.0

i realised that i can't do a sql query SELECT statement after i've issued either UPDATE or DELETE or INSERT to the database.
the connection will hang when it reaches the SELECT query.
this only happened if my connection has a BeginTrans but haven't reach until CommitTrans.

is this a meant to be feature or it's a bug?
if it's a feature, pls teach me how to overcome it.

7 replies

by donq

That's ecause Begin Trans is waiting for Commit OR Rollback before posting your Update, Delete, or Insert. Do 1 thing at a time! It not a bug - just Commit an open Transaction before beginning another recordset operation. Move your SELECT line below the Commit Trans line and everything should work fine?

by raffi_

I've only seen this when the statement is SELECT INTO.

Here is the MS_KB number for the problem:

Article ID: Q67874

Regards
Raffi_

by xxx123

donq is correct. I just wanted to add that when I need to refer to a recordset in order to construct my transactions, I use a separate connection for the "read" recordset.

This discussion is closed to new replies.