Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8044957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:23:40+00:00 2026-06-05T05:23:40+00:00

I’m facing timeout issues when performing multiple SELECTs after moving database to a different

  • 0

I’m facing timeout issues when performing multiple SELECTs after moving database to a different server, in a relic (VB6 application) I’ve been tasked to patch up. Things worked flawlessly in the old environemnt, the new one contains carbon copies of the old tables.

NOTE! The new database was built from scratch (that is, DBA ran many CREATE TABLE + INSERT scripts to create carbon copies of tables then fill them with the old data).

This is the error source:

// "conn" is being initialized outside the function
Public Function PerformOperation(ByRef conn as ADODB.Connection, query as string) as Boolean
  Dim rs as ADODB.Recordset
  //This below is the timeout source
  rs.Open conn, query, adOpenStatic, adLockReadOnly

  If Not (rs.EOF or rs.BOF) Then
    rs.MoveFirst
    //assign data to many variables
  End If

ExitPoint:
  If Not (rs Is Nothing) Then
    If (rs.State = adStateOpen) Then rs.Close
    Set rs = Nothing
  End If   

  Exit Function

Error:
  MsgBox "Blah blah"
  Resume ExitPoint
  Resume 0

End Function

Function is called like this

conn = New ADODB.Connection
conn.ConnectionString = "..."
conn.Open

For i = 1 To RowCount //reading data from a grid component (data is correct!)
  //very long select here... kept short
  query = "SELECT something FROM somewhere WHERE <manyFields> = <manyValues>" 
  If PerformOperation(conn, query) = True Then
    //UPDATE another table based on the SELECT data
    // NOTE: this occurs on a DIFFERENT, INDEPENDENT ADODB.Connection object
  End If
Next i

The first time PerformOperation is called it goes through fine, second time through it times out no matter how long i set the CommandTimeout. It also works OK if the cycle “cycles” a single time.

Big problem here is, all I have to try things out is the production environment so I’ll need to be extra careful. I also don’t have a very deep DBA knowledge at hand… Just a very very old piece of software which will eventually be ported to .NET but needs to be dealt with in the meantime…

How can I check and/or fix this issue ? This has to work for any length of the For cycle

Many thanks for any suggestion (as always, if i missed any essential detail point it out and i’ll provide it if i can).

EDIT #1
I’ve expanded the first and secondo code blocks to provide deeper details about what’s going on. Comments changed in order to try and fix highlighting (single quotes mess up coloring).

EDIT #2
Enabling Multiple Active Result Sets (MARS) in the connection string didn’t help either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:23:41+00:00Added an answer on June 5, 2026 at 5:23 am

    Issue was solved editing this line:

    If PerformOperation(conn, query) = True Then
    

    like this

    If PerformOperation(connOther, query) = True Then
    

    Basically, method call has been moved to its own connection, declared exactly like the other one. Now it works, though I don’t really know why: this is the result of some wild editing in an attempt to patch things up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a reasonable size flat file database of text documents mostly saved in
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.