troubleshooting Question

Need to wrap multiple queries using VB ODBC interface

Avatar of heath_kit
heath_kit asked on
Microsoft Access
3 Comments1 Solution200 ViewsLast Modified:
Hello All,

I have created a series of queries in an Access DB that I need to execute on a daily basis to propagate data from other DBs into this Access DB. I wrote a Visual Basic program to do that. I uses ODBC to launch queries in the Access DB successfully. However, I want to execute a series of queries in a transaction. Can anyone give me a hint on whether this can be accomplished using the ODBC interface? And how?

Code to execute the SQL looks like this:

  sSQL = "exec [Identify New Projects (from Advantage)]"
  nRetCode = SQLExecDirect(Connection(1).hstmt, sSQL, Len(sSQL))
  If nRetCode <> SQL_SUCCESS Then GoTo roExit

How would I execute multiple statements like this and wrap this in a transaction and rollback if any fail?

Thanks for any help.


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros