Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connection timeout 1

Status
Not open for further replies.

chauphs

Programmer
Feb 10, 2005
6
US

I have a vb script that connects to a sybase DB, executes a store procedure, read back data through a record set. Sometimes, it will encounter a "read from server has timed out". Can someone tell me how to correct this issue ?

Here is the code:

set conn = CreateObject("ADODB.Connection")
conn.open "Provider=MSDASQL.1;DRIVER={Sybase ASE ODBC Driver};UID=john;PWD=johnpw;DB=dbname;SRVR=dbsevr"
str = "spc_vsp_extract"
set rst = CreateObject("ADODB.Recordset")

set obj = CreateObject("ADODB.Command")
set obj.ActiveConnection = conn
obj.CommandText = str
obj.CommandType = 4
set rst = obj.execute
do until rst.EOF
OutFile.WriteLine rst.Fields.Item(0)
rst.movenext
loop
 
obj.CommandTimeout = 0

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top