Refresh spreadsheet from database through ODBC

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I put a spreadsheet on our web server.
The spreadsheet refresh the data while opening.
The data source from MS Access and the Access application execute a stroed
procedure from SQL server through ODBC.

It refreshes the data if user's machine has ODBC DSN to connect my database.

Is it required to have ODBC DSN on user's machine to refresh spreadsheet
from SQL server database?


Any information is great appreciated,
 
You don't need the DSN if you build what you need in the connection
string. Here's an example using ODBC to another Excel file.

With Selection.QueryTable
.Connection =
("ODBC;DBQ=C:\Blah;DefaultDir=C:\Blah;Driver={Microsoft Excel Driver
(*.xls)};Extensions=xls;")
.Sql = ("SELECT blah blah blah" & _
"FROM `C:\Blah\Blah`.`Sheet1$` `Sheet1$`")
.Refresh BackgroundQuery:=False
End With

Try recording adding a query and it should build your connection
string.

Good luck

tlxl
 
Back
Top