Click to See Complete Forum and Search --> : ASP - [Microsoft][ODBC SQL Server Driver]Timeout expired.. pls help.


ongwc
January 21st, 2003, 12:31 AM
Hi all,
I have this problem, everytime I load my ASP I got this "[Microsoft][ODBC SQL Server Driver]Timeout expired" error, I have checked and tried runing my "Stored Procedure/Query" in "MSSQL Query Analyzer" it only took less than 1 second to complete but how come the ASP said "timout expired"? Here is my code:


strDBConn = "driver={SQL Server};server=My_Server_IP;database=My_DB;uid=uid;
pwd=pwd"

strSQL = "exec My_SP 1;"
strSQL = strSQL & "exec My_SP 2;"
strSQL = strSQL & "exec My_SP 3;"
strSQL = strSQL & "exec My_SP 4"

Set adoRsl = Server.CreateObject("ADODB.Recordset")
adoRsl.CursorLocation = adUseClient
adoRsl.Open strSQL, strDBConn, adOpenForwardOnly,
adLockReadOnly

Do While Not adoRsl.EOF
...
Loop

Set adoRsl = adoRsl.NextRecordset
Do While Not adoRsl.EOF
...
Loop
...



Does anyone know how to solve this problem?
Thanks for your time...

Thread1
January 22nd, 2003, 05:36 AM
Well I think the error called from the client ODBC driver, it seems that it does not connect to the server with your connect string.

You better check your connection string..;)

DeivaGanesh
January 22nd, 2003, 06:13 AM
Hope u get this error only when try to access the .nextrecordset method.. if so the problem is with the MDAC version in the server.
update the MDAC 2.6 in ur server.


FYI..

instead of executing n no of sp's and getting n recordsets u can write a wrapper sp,and execute the same,which in turn will have the sp's u execute and get the desired no of recordsets.