Refresh spreadsheet from database through ODBC

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,
 
X

xydata

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top