|
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
%>
----------------------------------------------------
|
| 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,
|
|
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 ([email protected])
|