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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timeout Expired

Status
Not open for further replies.

btgroup

MIS
Joined
Jan 21, 2003
Messages
64
Location
US
Hi,

I have an SQL command that I am executing through some VB code. The code is as follows:

Dim oss_conn as ADODB.Connection
Dim oss_rs as ADODB.Recordset
Dim sql_statement as String
oss_conn.Open "...typical connection string..."
sql_statement = "UPDATE sales SET override = 1"
Set oss_rs = oss_conn.Execute(sql_statement)

I am able to manually run the sql statement, but my VB code gives me a Timeout expired error. When I switch the sql statement to update a different table, it runs perfectly. I have tried to extend the commandtimeout property and it didn't help. The table is very small.

Any ideas? Maybe it is a permissions issue on the table? I am using the same user when I connect through the VB code as when I run the statement manually.

Thanks in advance for any help.
 
Thank you. There was indeed a process blocking the query. Once I closed the connection and re-opened it, everything ran as expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top