473,378 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Time out for ADO.

I am using ADO to connect to SQL 7.0. At times the connection timeout
expires. Is there any way to inrease the default time out? I think currently
its 60 secs.

Here is the code that I use to establish ADO connection.
set rs = Server.CreateObject("ADODB.RecordSet")

sCon = "DRIVER={SQL
Server};SERVER=Indy2;DATABASE=ProdProtrans;UID=xx; PWD=xxxxxxx"
Any suggestions?
Thanks
TAHIR KHAN
Jul 19 '05 #1
4 4631
Tahir aman wrote:
I am using ADO to connect to SQL 7.0. At times the connection timeout
expires. Is there any way to inrease the default time out? I think
currently its 60 secs.

Here is the code that I use to establish ADO connection.
set rs = Server.CreateObject("ADODB.RecordSet")

sCon = "DRIVER={SQL
Server};SERVER=Indy2;DATABASE=ProdProtrans;UID=xx; PWD=xxxxxxx"

Two suggestions:
1. Stop using ODBC. Use the native SQL Server provider:
sCon="Provider=SQLOLEDB;Data Source=Indy2;" & _
"Initial Catalog=ProdProtrans;User Id=xx;Password=xxx"
2. Set the connection's ConnectionTimeout property. This may not have the
effect you are after. There are two processes involved in connecting to the
database server. There is the initial search through DNS to find the
database. You have no control over how long it takes this process to time
out. After this process has actually found the server, then the ADO
connection process begins. This is where the ConnectionTimeout property has
control.

HTH,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2

"Tahir aman" <Ta*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am using ADO to connect to SQL 7.0. At times the connection timeout
expires. Is there any way to inrease the default time out? I think currently its 60 secs.

Here is the code that I use to establish ADO connection.
set rs = Server.CreateObject("ADODB.RecordSet")

sCon = "DRIVER={SQL
Server};SERVER=Indy2;DATABASE=ProdProtrans;UID=xx; PWD=xxxxxxx"
Any suggestions?
Thanks
TAHIR KHAN


Perhaps you could post your query that times out here and we could take a
look at that to improve it's performance...

Neil
Jul 19 '05 #3
I am not sure if my previous message went thru or not, but I will do it
again, just to make sure.
BOB: Not that I mind using native SQL Server provider, can I use the
ConnectionTimeout property with odbc? I am asking this for my own knowledge.
I tried doing it your way and seems to be working fine.

Using native SQL Server provider is better for other reasons too or just for
time out reasons?

So can I do this or should this be valid statement? sCon = "DRIVER={SQL
Server};SERVER=Indy2;DATABASE=ProdProtrans;UID=xx; PWD=xxxxxxx
ConnectionTimeout = 300"

Thanks for your help.
Tahir Khan


"ecPunk" <ne****@hotmail.com> wrote in message
news:4k*********************@ursa-nb00s0.nbnet.nb.ca...

"Tahir aman" <Ta*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am using ADO to connect to SQL 7.0. At times the connection timeout
expires. Is there any way to inrease the default time out? I think

currently
its 60 secs.

Here is the code that I use to establish ADO connection.
set rs = Server.CreateObject("ADODB.RecordSet")

sCon = "DRIVER={SQL
Server};SERVER=Indy2;DATABASE=ProdProtrans;UID=xx; PWD=xxxxxxx"
Any suggestions?
Thanks
TAHIR KHAN


Perhaps you could post your query that times out here and we could take a
look at that to improve it's performance...

Neil

Jul 19 '05 #4
Tahir aman wrote:
I am not sure if my previous message went thru or not, but I will do
it again, just to make sure.
BOB: Not that I mind using native SQL Server provider, can I use the
ConnectionTimeout property with odbc?
Yes. Why not? It's the "ADO Connection" object's ConnectionTimeout property,
not the "ADO OLEDB Connection" object's ConnectionTimeout property. ADO
object properties do not depend on what provider is being used.
I am asking this for my own
knowledge. I tried doing it your way and seems to be working fine.

Using native SQL Server provider is better for other reasons too or
just for time out reasons?
Yes. ODBC has been deprecated:
http://msdn.microsoft.com/library/en...components.asp


So can I do this or should this be valid statement? sCon =
"DRIVER={SQL
Server};SERVER=Indy2;DATABASE=ProdProtrans;UID=xx; PWD=xxxxxxx
ConnectionTimeout = 300"

Yes, but that would mean you would still be using the obsolete ODBC provider
....

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
5
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
3
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And...
1
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time =...
2
by: Roseanne | last post by:
We are experiencing very slow response time in our web app. We run IIS 6 - windows 2003. I ran iisstate. Here's what I got. Any ideas?? Opened log file 'F:\iisstate\output\IISState-812.log'...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.