App hangs up while inserting records into SQL table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dbanalyst
    New Member
    • Aug 2007
    • 12

    App hangs up while inserting records into SQL table

    I have a VB6 app that executes an SQL stored procedure that returns a recordset that I loop through 1 record at a time. During the looping process, I am attempting to insert contents from the recordset to another SQL table. This seems to work with small recordsets, but hangs the app if the recordset is large. When I use the SQL Analyzer tool and execute the "insert" command it works fine, so the syntax is correct. Also, if the VB6 calls a "select" for the recordset instead of a stored procedure, it also works just fine. Any help would be greatly appreciated!!!
  • shrimant
    New Member
    • Sep 2007
    • 48

    #2
    Originally posted by dbanalyst
    I have a VB6 app that executes an SQL stored procedure that returns a recordset that I loop through 1 record at a time. During the looping process, I am attempting to insert contents from the recordset to another SQL table. This seems to work with small recordsets, but hangs the app if the recordset is large. When I use the SQL Analyzer tool and execute the "insert" command it works fine, so the syntax is correct. Also, if the VB6 calls a "select" for the recordset instead of a stored procedure, it also works just fine. Any help would be greatly appreciated!!!
    Add some Error Handler to the code and make sure to add the Keyword Doevents insede the loop.

    Comment

    • dbanalyst
      New Member
      • Aug 2007
      • 12

      #3
      Think I figured it out. Remember when I said:
      "During the looping process, I am attempting to insert contents from the recordset to another SQL table."
      Well, the change I made was in doing the insert into the other SQL table, I changed the rdo connection to ado connection, and it works just fine now. So I'm guessing there's a limit on the size of a recordset for an rdo connection, or something? Anyway, thanks for helping me think through this.

      Comment

      Working...