I have an Access db on several users' laptops. This Access db can upload records to an sql server db. To perform the upload, I used an adodb.connection and an adodb.command.
When the command.execute method fires, sql server ALWAYS gets the data and does the insert. However, SOMETIMES the vba function stops running right on the command.execute line. Eventually, the command.execute times out and reports an error- even though the insert actually worked.
Here are a couple of fixes that I am considering:
1. I use the same command object repeatedly. I just change the parameters and call .execute again. Perhaps I should instantiate a new command EVERY single time. This would be ineficient but I am moving a tiny amount of data, so efficiency is not a key concern.
2. Perhaps I should make the command run asynchronously. Here is the syntax I am considering:
myCommand.Execute , , adAsyncExecute
Are those good ideas? I look forward to your feedback.
When the command.execute method fires, sql server ALWAYS gets the data and does the insert. However, SOMETIMES the vba function stops running right on the command.execute line. Eventually, the command.execute times out and reports an error- even though the insert actually worked.
Here are a couple of fixes that I am considering:
1. I use the same command object repeatedly. I just change the parameters and call .execute again. Perhaps I should instantiate a new command EVERY single time. This would be ineficient but I am moving a tiny amount of data, so efficiency is not a key concern.
2. Perhaps I should make the command run asynchronously. Here is the syntax I am considering:
myCommand.Execute , , adAsyncExecute
Are those good ideas? I look forward to your feedback.