Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timeout Expired 80040E31

Status
Not open for further replies.

grnzbra

Programmer
Mar 12, 2002
1,273
US
I am using vbscript to call a stored procedure in SQL Server and get an error "Timeout Expired" "80040E31". When the SP is run in QueryAnalyzer, it runs fine.

Googling that ran me into suggestions for:
wscript.timeout = 0
which got me an error message saying that there was no such object.
Also, a google of "wscript.timeout" indicated that unless a timeout is set, it will run forever; the timeout is only to prevent it from running forever.

Another suggestion at the microsoft website offered:
conn.CommandTimeout = 0.
That didn't blow up, but it also didn't seem to do anything (I still got the timeout in 30 seconds)
I tried setting it for 7200, (2hours) but that also timed out at 30 second mark.

How can I make this thing to run until done?

 
Thanks for the suggestion. I checked and we have the latest service packs as suggested by the reference.

However, I cheated and created a workaround. The stored procedure requires getting the records from only one file at a time. The VB loaded one file into a table and called the SP to process it. When the stored procedure was finished, the VB was supposed to start up and loop to the next file and load that and call the SP etc, etc.

The workaround was to modify the SP to work with a table into which all the files had been loaded (each record having a field indicating the name of the file which containd the date it was created), and modify the VB to load all the available files into the table but not call the SP. Now the VB runs and then the SP runs.

I still don't know what caused the timeout, and, while my immediate problem is solved, if the time ever comes that I can't run something as two separate steps, well...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top