The OleDbCommand is currently busy Open, Fetching -- CommandText

In the code below, I get the error:

   "The OleDbCommand is currently busy Open, Fetching."

On the following line on the second time through:

   cmdReader2.CommandText = strSQL

How do I correct this?

---
While dreader1.Read()
   If Not dreader1.IsDBNull(2) Then
      If dreader1.GetString(2) = "F" OrElse IsNumeric(dreader1.GetString(2)) Then
         strSQL = "SELECT Field1 FROM Table1 WHERE Field2 = " & dreader1.GetInt32(0).ToString & " AND Field3 = 0"
         cmdReader2.CommandType = CommandType.Text
         cmdReader2.CommandTimeout = 0
         cmdReader2.CommandText = strSQL
         dreader2 = cmdReader2.ExecuteReader()
         While dreader2.Read
              dtDate = dreader2.GetDateTime(0)
         End While
         
         strSQL = "UPDATE Table1 SET Field4 = #" & dtDate & "# WHERE Field2 = " & dreader1.GetInt32(0).ToString
         cmdExecute.CommandType = CommandType.Text
         cmdExecute.CommandTimeout = 0
         cmdExecute.CommandText = strSQL
         cmdExecute.ExecuteNonQuery()
      End If
   End If
End While

<code removed per request http:Q_21903646.html>
---


LVL 9
GivenRandyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

g_johnsonCommented:
dreader2.close after end while ???

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GivenRandyAuthor Commented:
LMAO. Of course. That's why I needed a second set of eyes. Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.