|
-
Nov 16th, 2009, 02:07 PM
#1
Thread Starter
New Member
Possible to automatically close a 'SQL Timeout Expired' pop-up window??
Hi all,
I'm at a lost here...
I have a VB6 App running on a server, that queries an SQL Server 2000 database every 3 minutes, 24/7. Most of the time, the querying is fine but every week or so it gets a 'SQL Timeout Expired' pop up and so all the processes stop working until somebody physically clicks OK through the window and then the processes of the App continue.
I'm wondering, is there is ANY way to automate this clicking? or maybe disable the timeout window from appearing for timeouts only? Would turning this windows app into a windows service help at all?
ANY help or info would be very appreciated.
Thank you in advance!
-
Nov 16th, 2009, 02:16 PM
#2
Re: Possible to automatically close a 'SQL Timeout Expired' pop-up window??
Thread moved to 'Database Development' forum
Is the popup something which is generated by your program, or by something else (most likely the driver/provider)?
What kind of code are you using to run the queries?
-
Nov 16th, 2009, 02:28 PM
#3
Thread Starter
New Member
Re: Possible to automatically close a 'SQL Timeout Expired' pop-up window??
no, the pop up is not generated by my program. Probably by the ODBC I'm using.
When the App starts, it connect to the SQL Server 2000 database using an ODBC. It keeps the connection open until the App is manually closed.
Here's the qurying code. Fairly straight-forward:
sql2 = "mySQLQuery"
Set rsApproved = New ADODB.Recordset
gConn.CommandTimeout = 120000
rsApproved.Open sql2, gConn.ConnectionString, adOpenStatic, adLockOptimistic
-
Nov 16th, 2009, 03:53 PM
#4
Re: Possible to automatically close a 'SQL Timeout Expired' pop-up window??
It would help to be able to see the actual popup, so if you can, please show us a screen shot (I realise that it may take a while for it to be shown again!).
One thing about the code you have shown is that you are using gConn.ConnectionString where you should really be using just gConn by itself.
The way you have it means that you actually create and use another connection object (which only exists while rsApproved is open), which does not have the same properties as gConn (apart from the connection string). CommandTimeout is one of the properties that it will not share.
It is also debatable if keeping the connection open is wise, as a loss of connection for any reason in the time you are not using it will result in errors (possibly the one you are having) when you next try to use it.
As it is open 24/7, and only being used every 3 minutes, I would recommend opening just before you run the query, and closing it just after.
The use of ODBC could potentially be a factor, so switching to OLEDB instead might help - but then again it might not.
-
Nov 16th, 2009, 05:10 PM
#5
Thread Starter
New Member
Re: Possible to automatically close a 'SQL Timeout Expired' pop-up window??
Ok, perfect, thanks Si !!
I'll try out a few things with the gConn.
Thanks a bunch!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|