petermeachem
Programmer
I have a bit of a problem.
I am doing an update query which should complete in about 1 second with a single user.
If I deliberately lock the database by running the update on the same records from another pc, I want a fairly prompt message to the first user to that effect, so they can resave.
If I do this:-
Dim cmd As New ADODB.Command
cmd.CommandType = adCmdText
cmd.CommandText = csql
cmd.CommandTimeout = 5
Set cmd.ActiveConnection = cnn
Set rs = cmd.Execute(L)
The first programme hangs completely for a very long time. Minutes in fact.
If I do this instead:-
cnn.Execute csql, L
I cannot set a timeout.
If I do this:-
cmd.Execute L
The number of records updated is always 0, although the records are updated properly.
Am I missing something obvious here?
Using VB6, Access database, updating about 5 records out of 200,000.
I just need to:-
a) get the timeout working.
b) be sure that the records have actually saved when the software says they have so I can clear the save button.
In the current VB3 programme, the equivalent update will hang for 30 secs and then just return with no error, so I cannot tell whether the data has been saved or not. Hence the move to VB6 and ADO. It just seems to make it worse though.
Any help appreciated. Changing the database to SQL Server etc is not an option by the way. Peter Meachem
peter@accuflight.com
I am doing an update query which should complete in about 1 second with a single user.
If I deliberately lock the database by running the update on the same records from another pc, I want a fairly prompt message to the first user to that effect, so they can resave.
If I do this:-
Dim cmd As New ADODB.Command
cmd.CommandType = adCmdText
cmd.CommandText = csql
cmd.CommandTimeout = 5
Set cmd.ActiveConnection = cnn
Set rs = cmd.Execute(L)
The first programme hangs completely for a very long time. Minutes in fact.
If I do this instead:-
cnn.Execute csql, L
I cannot set a timeout.
If I do this:-
cmd.Execute L
The number of records updated is always 0, although the records are updated properly.
Am I missing something obvious here?
Using VB6, Access database, updating about 5 records out of 200,000.
I just need to:-
a) get the timeout working.
b) be sure that the records have actually saved when the software says they have so I can clear the save button.
In the current VB3 programme, the equivalent update will hang for 30 secs and then just return with no error, so I cannot tell whether the data has been saved or not. Hence the move to VB6 and ADO. It just seems to make it worse though.
Any help appreciated. Changing the database to SQL Server etc is not an option by the way. Peter Meachem
peter@accuflight.com