ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Export Excel to SQL Server (https://www.excelbanter.com/excel-programming/273796-export-excel-sql-server.html)

Tom Y

Export Excel to SQL Server
 
Whats the best way to export data from an excel
spreadsheet that contains a Web Query to SQL Server (or
any DB). How can I get the
Web Query to Refresh before the export takes place(DTS or
whatever)

Any help on this would be great


Thomas Bartkus[_2_]

Export Excel to SQL Server
 
"Tom Y" wrote in message
...
Whats the best way to export data from an excel
spreadsheet that contains a Web Query to SQL Server (or
any DB). How can I get the
Web Query to Refresh before the export takes place(DTS or
whatever)

Any help on this would be great


My approach would be to set up an Access (.mdb) file containing linked
tables to both the SQL Server table you are targeting as well as the
spreadsheet containing the Web query. You can then define (using Accesss)
an APPEND or UPDATE query that will do what you wish with the SQL server
table.

You can automate with Excel/VBA code by doing a QueryTable.Refresh for the
web query then .Execute your stored APPEND or UPDATE query.

--
Thomas Bartkus
www.BartkusConsulting.com



Tom Y[_2_]

Export Excel to SQL Server
 
Thanks for the help Thomas!

Where would I be doing the QueryTable.Refresh from? Where
would this code be?

Thanks


-----Original Message-----
"Tom Y" wrote in message
...
Whats the best way to export data from an excel
spreadsheet that contains a Web Query to SQL Server (or
any DB). How can I get the
Web Query to Refresh before the export takes place(DTS

or
whatever)

Any help on this would be great


My approach would be to set up an Access (.mdb) file

containing linked
tables to both the SQL Server table you are targeting as

well as the
spreadsheet containing the Web query. You can then

define (using Accesss)
an APPEND or UPDATE query that will do what you wish with

the SQL server
table.

You can automate with Excel/VBA code by doing a

QueryTable.Refresh for the
web query then .Execute your stored APPEND or UPDATE

query.

--
Thomas Bartkus
www.BartkusConsulting.com


.



All times are GMT +1. The time now is 12:07 PM.

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