SQL timeout in VB program using ADO

SQL timeout in VB program using ADO

Post by Thomas Tod » Thu, 11 Jan 2001 05:50:02



We have a new application group that is just starting to use VB and SQL
Server 7.  The VB code is trying to execute a large query that will probably
take about 90 seconds to complete.  The application is receiving a SQL
timeout error.  The exact message is

Run-time error -2147217871 [Microsoft][ODBC SQL Server Driver]Timeout
expired.

When the app connects to SQL Server, it is specifying a timeout parm of 600.
Here is the connection string:

ConnectionString=driver={SQL
Server};Server=XXXX;database=YYYY;uid=aaaa;pwd=xxxx;timeout=600

This is all completely new to me and I'm hoping that it is just something
simple that is wrong.

If anyone can shed some light on this I would greatly appreciate it.

Thanks in advance

 
 
 

SQL timeout in VB program using ADO

Post by Lasse Edsvi » Thu, 11 Jan 2001 15:57:48


Thomas,

In the controlpanel+ODBC select the driver for it and choose properties, there
you should have the timelimit for the driver.

further more I would like you to recommend you to use the sqloledb.1 provider
instead to connect to your sql server, and not the one you use now.

hope it helps
/Lasse


> We have a new application group that is just starting to use VB and SQL
> Server 7.  The VB code is trying to execute a large query that will probably
> take about 90 seconds to complete.  The application is receiving a SQL
> timeout error.  The exact message is

> Run-time error -2147217871 [Microsoft][ODBC SQL Server Driver]Timeout
> expired.

> When the app connects to SQL Server, it is specifying a timeout parm of 600.
> Here is the connection string:

> ConnectionString=driver={SQL
> Server};Server=XXXX;database=YYYY;uid=aaaa;pwd=xxxx;timeout=600

> This is all completely new to me and I'm hoping that it is just something
> simple that is wrong.

> If anyone can shed some light on this I would greatly appreciate it.

> Thanks in advance


 
 
 

SQL timeout in VB program using ADO

Post by brc » Thu, 11 Jan 2001 06:59:34


Try explicitly providing the connection timeout property of either the
connection object or the command object.

oCnnObj.ConnectionTimeOut=90

Brum

Quote:> We have a new application group that is just starting to use VB and SQL
> Server 7.  The VB code is trying to execute a large query that will
probably
> take about 90 seconds to complete.  The application is receiving a SQL
> timeout error.  The exact message is

> Run-time error -2147217871 [Microsoft][ODBC SQL Server Driver]Timeout
> expired.

> When the app connects to SQL Server, it is specifying a timeout parm of
600.
> Here is the connection string:

> ConnectionString=driver={SQL
> Server};Server=XXXX;database=YYYY;uid=aaaa;pwd=xxxx;timeout=600

> This is all completely new to me and I'm hoping that it is just something
> simple that is wrong.

> If anyone can shed some light on this I would greatly appreciate it.

> Thanks in advance

 
 
 

SQL timeout in VB program using ADO

Post by Don Arsenaul » Thu, 11 Jan 2001 07:41:42


I am unfamiliar with the "timeout" param of the connection string.  I
remember that ODBC has the LoginTimeout parameter; but that does not effect
query execution.

I have used the ConnectionTimeout and CommandTimeout properties of the ADO
Connection object.

Don.


We have a new application group that is just starting to use VB and SQL
Server 7.  The VB code is trying to execute a large query that will probably
take about 90 seconds to complete.  The application is receiving a SQL
timeout error.  The exact message is

Run-time error -2147217871 [Microsoft][ODBC SQL Server Driver]Timeout
expired.

When the app connects to SQL Server, it is specifying a timeout parm of 600.
Here is the connection string:

ConnectionString=driver={SQL
Server};Server=XXXX;database=YYYY;uid=aaaa;pwd=xxxx;timeout=600

This is all completely new to me and I'm hoping that it is just something
simple that is wrong.

If anyone can shed some light on this I would greatly appreciate it.

Thanks in advance

 
 
 

1. Programming VB Script in DTS Package using ADO

Please help!

I have two tables.  One is in SQL Server and the other is in FoxPro.  They
are identical (fields, etc.)

I want to take the result of the FoxPro table (SELECT * FROM tblExample) and
append it to the SQL Server table using ADO in a DTS Package.  Does anyone
know how to do this?  An example would be great, too.  I hope I'm not asking
for too much here.  The reason we aren't just using the DTS package like
it's meant to be used is because part of the path of the FoxPro table is
variable (different month's data is stored in different directories).

E-Mail responses are welcome:

2. PICK VACENCY IN THE UK (EAST)

3. Calling AS/400 CL Program using Client Access ODBC, VB, and ADO

4. The oracle translate function

5. Error when using AddNew method in ADO (using ADO 2.7 SP1 from VB 6 SP4)

6. JDBC Connection fails with SE 7.24

7. connecting to a remote server using vb+sql server using ADO

8. New--looking for the simplest database

9. VB/VB ADO Programming for shared access

10. Can't set timeout on MyODBC/MySQL from an ADO/ASP program on Windows XP

11. ADO connection timeout problem in Script host program