execute multiple mySQL statements at once

austin350s10

Active Member
Joined
Jul 30, 2010
Messages
321
I am working on some code that needs to add data into a database. I have no problems adding data when I am trying to execute one SQL statement at a time. My problem comes in when I attempt to execute 2 or more SQL statements at once. I know my syntax is correct, as I am able copy the value of the mySQL variable and execute it directly in my database without problems. Is there a way to run multiple SQL statements without looping through and executing each statement? Any ideas would be appreciated...

my code snippet:
Code:
'ContactSQL and RefSQL both contain an INSERT statement
mySQL = ContactSQL & RefSQL
Sql.Execute mySQL
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top