Hi. Im using the code below but everytime somebody runs a huge script on query analyzer or the server is having a processing a huge load, my program experiences timeout. Im using functions to ease coding. Is there any problem with my code? How can I improve it so that I wouldn't receive any timeouts or timing out is normal? Thank you very much....
Code:Public Sub EstablishConnection(ByRef pCon As Connection) Set pCon = New Connection pCon.ConnectionTimeout = 0 pCon.CommandTimeout = 0 pCon.ConnectionString = gConnectionString 'gConnectionString = "Provider='SQLOLEDB.1';Persist Security Info='False';Data Source='" & txtServerName + "'; Initial Catalog='" & txtDbaseName.Text & "'; User ID='" & txtUserName & "'; password='" & txtPassword & " End Sub Public Sub EstablishRecordsource(ByRef pRst As Recordset, ByVal pSource As String, ByRef pActiveCon As Connection, ByVal pCursorType As CursorTypeEnum, ByVal pOptions As Long) Set pRst = New Recordset pRst.Open pSource, pActiveCon.ConnectionString, pCursorType, adLockOptimistic, pOptions End Sub




Reply With Quote