ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2002 Macro to Execute SQL Statement (https://www.excelbanter.com/excel-programming/304122-excel-2002-macro-execute-sql-statement.html)

David Weilmuenster[_2_]

Excel 2002 Macro to Execute SQL Statement
 
Hi, I'm trying to write a macro in Excel 2002 to execute
the following (example) SQL statement:

insert into `C:\Documents and
Settings\User\Desktop\Test`.`Master$` (Apples, Pears,
Oranges,Store)
SELECT `Update$`.Apples, `Update$`.Pears,
`Update$`.Oranges, `Update$`.Store
FROM `C:\Documents and
Settings\User\Desktop\Test`.`Update$` `Update$`

The macro would run from inside the test.xls spreadsheet
which has already been defined as an ODBC Data Source. I
know that the SQL statements are correct, because I can
manually enter them into MS Query from inside Excel and
get the desired result.

I've tried reading the MS Visual Basic help for this, but
it's far above my expertise.

Any clues/suggestions would be much appreciated.

Thanks,
David



All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com