Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/05/2006, 17:51
Avatar de trasgukabi
trasgukabi
 
Fecha de Ingreso: septiembre-2004
Mensajes: 2.749
Antigüedad: 20 años, 8 meses
Puntos: 18
script para controlar el timeout mediante el objeto command y procedimientos almacenados:
Código:
Dim colErrs, objError, timeout, adoConn, adoCmd
timeout=False
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.CursorLocation = 3 'adUseClient
adoConn.Open Session("UserConnStr")
adoConn.IsolationLevel = 256
'empieza la transacción
adoConn.BeginTrans
Set adoCmd = Server.CreateObject("ADODB.Command")
'aqui se le dan 45 segundos.
adoCmd.CommandTimeout = 45
adoCmd.ActiveConnection = adoConn
adoCmd.CommandText = "tu_proc_almacenado"
adoCmd.CommandType = 4 'proc. almacenado
adoCmd.Execute
Set colErrs=adoConn.Errors
If adoConn.Errors.Count <> 0 then
For Each objError In colErrs
'nº de error para timeout
If objError.Number=-2147217871 Then
adoConn.RollbackTrans
Response.Write "Error de conexión. Inténtelo más tarde"
timeout=True
adoConn.Errors.Clear
Exit For
End If
Next
End If
Set adoCmd = Nothing

If Not timeout Then
adoConn.CommitTrans
End If
adoConn.Close
Set adoConn = Nothing
también puedes hacer tú un control de errores basándote en el que ya tienes con el nº de error de timeout (-2147217871)

Espero que sirva, un saludo.