[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference amcucs::ms-sqlsvr

Title:Microsoft SQL Server Support
Notice:Please Registar, Note #11
Moderator:AMCUCS::BETTS
Created:Tue Aug 23 1994
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:382
Total number of notes:1233

370.0. "MS ODBC SQL Server Drive Timeout Expired?" by GIAMEM::LAI (OGOPW::LAI (Jimmy) DTN:276-9709 M/S:OGO-1/L17 (PSG)) Thu May 08 1997 22:51

    Hi,
    
       I've encountered an ODBC timeout error as follows,
    
    [Microsoft][ODBC SQL Server Driver]Timeout expired
    
       It is a Web application that makes ODBC connection
       to MS SQL Server via IIS server. Is there a way that
       the default ODBC timeout can be set to a higher value?
    
       Your help is much appreciated.
    
       Thanks in advance.
    
       Regards,
    
    /JL
T.RTitleUserPersonal
Name
DateLines
370.1XSTACY::imladris.ilo.dec.com::grainneGrainne Ni ChoilighFri May 09 1997 09:3052
You don't say what database access technology you're using with
IIS, but if you're using Active Server Pages and ActiveX Data
Objects, then you can set the timeout value when you open the
connection. The following is taken from the 'Friendship Insurance
Company' 'Client' sample, available on the Microsoft Visual Interdev
web-site. The database supplied with this sample is actually
an MS Access database, but I think this should work with SQL
Server as well.

----------- in global.asa -------------

Sub Session_OnStart
	
'-- This should be all one line - linebreaks are just for readability
		Session("client_ConnectionString") = 
	"DBQ=\\imladris\friendshipDB\clientdb.mdb;DefaultDir=\\imladris\friendshipDB;
Driver={Microsoft Access Driver(*.mdb)};DriverId=25;FIL=MSAccess;
ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;Threads=3;
UID=admin;UserCommitSync=Yes;"
		Session("client_ConnectionTimeout") = 15
		Session("client_CommandTimeout") = 30
		Session("client_RuntimeUserName") = "admin"
		Session("client_RuntimePassword") = ""
	
End Sub

--------------------------------------

-------- in an .ASP file that opens a database connection -------------

<%
Set client = Server.CreateObject("ADODB.Connection")
client.ConnectionTimeout = Session("client_ConnectionTimeout")
client.CommandTimeout = Session("client_CommandTimeout")
client.Open Session("client_ConnectionString"), Session("client_RuntimeUserName"), 
Session("client_RuntimePassword")
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set rsAuto = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "SELECT autopolicy.*, vehicle.* FROM autopolicy, vehicle WHERE autopolicy.ap_veh_id = 
vehicle.veh_id AND (autopolicy.ap_cust_id = " & Session("cust_id") & ")"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = client
rsAuto.MaxRecords = 1
rsAuto.Open cmdTemp, , 0, 1
%>

----------------------------------------------------




370.2More info...HTML IDC & HTXGIAMEM::LAIOGOPW::LAI (Jimmy) DTN:276-9709 M/S:OGO-1/L17 (PSG)Fri May 09 1997 11:4319
    Thanks for your quick response. Here are more information on the
    database access technology that we are using:
    
    o ASP
    o HTML page via IDC and HTX.
    o Visual Basic DLL
    : (other upcoming internet tools)
    
    I am curious if there is a setting in the ODBC or MS SQL server
    side that the default timeout setting can be set higher to fix
    the access problem in general. I think the default setting is to
    be n seconds (15?). So, if the seting can be higher, says 180
    seconds (3 minutes), it'll take care most of the ODBC problem
    in our applications today. Can this default setting, ODBC side
    or MS SQL side, can be modified?
    
    Regards,
    
    
370.3XSTACY::imladris.ilo.dec.com::grainneGrainne Ni ChoilighTue May 13 1997 08:339
I'm sorry - I have no experience with IIS database access
via IDC/HTX files. I did wonder whether you could set the
default connection timeout as a property of the DSN - however,
although a likely-sounding property does exist for MS Access 
DSNs (PageTimeout) there's no corresponding property for
SQLServer DSNs, using the ODBC v3.0 drivers and driver manager.

Grainne Ni Choiligh @ILO (nichoiligh@mail.dec.com)