Do I need to add a pause betwen multiple update queries using OLE DB and Access?

I am using VB.NET with OLE DB, and Access.

I have a routine wich loops through and executes multiple update, make table, and delete table queries.

Do I have to add a pause after each querty before I run the next one? Should I close the connection after each query, or should I keep it open?


Who is Participating?
And for the actual question
>> Do I have to add a pause after each query


When you say
it is a "SYNCHRONOUS  CALL" that means unless the command is completed the next command is not executed, so you need not pause the system automatically pauses for you (since it is a synchronous call)

Now starting with .NET Framework 2.0 Asynchronous calls are also possible but the syntax for that is separate (BeginExecuteNonQuery) I don't think you are using that so do not worry about the pause.

nope if u are using data reader, u will have to close the reader in order for u to run the next statement.

From your description, sounds like you are using OleDbCommand, not OleDbDataAdapter. But I'll talk about both:

If you are using OleDbDataAdapter, you don't need to pause or worry about the connection, the dataadapter handles connection automatically for you. Normally you make all changes to dataset first, then call OleDbDataAdapter.Update():
   For ...
       'Changes to the dataset
This can be used for an existing table.

If you are using OleDbCommand, you don't need to pause either. Open and close connection outside the loop:
       myOleDbCommand = "your query"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.