Visual Basic - Problema de Conexion

Life is soft - evento anual de software empresarial
 
Vista:

Problema de Conexion

Publicado por ngenao (29 intervenciones) el 26/07/2006 18:52:16
Tengo la siguiente conexion a una base de datos y cuando la ejecuto me da un timeout y se detiene en la linea ultima linea.

Set carga = New ADODB.Recordset
Set Cnxn = New ADODB.Connection
strCnxn = "DRIVER=SQL SERVER=nombreservidor;DATABASE=Estados_IVR;APP=Visual Basic;AutoTranslate=No;QuotedId=No;AnsiNPW=No"
Cnxn.CommandTimeout = 0
Cnxn.Open strCnxn
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Problema de Conexion

Publicado por ngenao (29 intervenciones) el 26/07/2006 20:39:04
Le realice el cambio pero sige igual. hay momentos que esta bien y a veces da el time out
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Problema de Conexion

Publicado por csdk (127 intervenciones) el 27/07/2006 23:12:09
Public RST_EMPLEADO As New Recordset
Public RST_NIVEL As New Recordset
Public RST_ID As New Recordset
Public RST_MAK As New Recordset
Public ADOCONN As New ADODB.Connection 'CONEXION*************
Public Function conex()
On Error Resume Next
ADOCONN.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" + App.Path + "\INVENTARIO.mdb"

ADOCONN.Open

If Err.Number Then

MsgBox "Se ha producido el siguiente error:" & vbCrLf & _
Err.Number & ", " & Err.Description
End
End If
End Function
Public Function desconectar()
ADOCONN.Close
End Function

LLAMADA A LA FUNCION Y EJECUCION DE UN INSERT
Call conex
RST_NIVEL.Source = "INSERT INTO TB_MAQUINAS VALUES(" & Txt_cvlmak.Text & ",'" & TXT_NOM.Text & "','" & Txt_desc.Text & "')"
RST_NIVEL.ActiveConnection = ADOCONN
MsgBox "REGISTRO ALMACENADO", vbInformation
RST_NIVEL.Open
desconectar
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar