Link to home
Start Free TrialLog in
Avatar of Mehram
MehramFlag for Pakistan

asked on

VB --- Connection time Out

I have generated an SQL procedure which is having loop between several tables. When I am running this procedure from Query Analyzer result is coming perfect. But when I am calling it from VB through connection execute command it is showing error after few minutes “Error: Connection Time Out”.

Please help me how can I fix it?

Rgds.
Iqbal
Avatar of boyinapalli
boyinapalli
Flag of United Kingdom of Great Britain and Northern Ireland image

Increase the Connection TimeOut.

Example:

Private adoComp As New ADODB.Connection
adoComp .ConnectionTimeout = 600
Avatar of Mehram

ASKER

Dear Boyinapalli

I have tried it but problem is remain un changed

Pls find below my code detail


cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=School"
cn.ConnectionTimeout = 2000
cn.Execute "result_process2 @cyear='" & workingyear & "'"
msgbox "Done"

Runt time Error: 2147217871 Time out Expired


Awaiting for your assistant

Rgds.
Iqbal
Avatar of Mehram

ASKER

Dear Boyinapalli

I have tried it but problem is remain un changed

Pls find below my code detail


cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=School"
cn.ConnectionTimeout = 2000
cn.open
cn.Execute "result_process2 @cyear='" & workingyear & "'"
msgbox "Done"

Runt time Error: 2147217871 Time out Expired


Awaiting for your assistant

Rgds.
Iqbal
ASKER CERTIFIED SOLUTION
Avatar of boyinapalli
boyinapalli
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial