Hello Ladies and Gentlemen,
I have my spreadsheet with lots of lovely data being pulled into it from my sexy SQL databases using ODBC connex.
I move the spreadsheet to a friends pc who does not have the same odbc connections as I, funnily enough the query falls over. What I need is a piece of coded connection string to my sql server wich is embedded in the VBA.
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=myDSN;Description=myDSNDesc;UID=myUserName;PWD=myUserPassword;APP=Microsoft® Query;WSID=myWSID" _
, Destination:=Range("A1"))
.CommandText = Array("SELECT * " & Chr(13) & "" & Chr(10) & "FROM myTable")
.Refresh BackgroundQuery:=False
End With
any suggestions?
cheers,
Crazypabs
The only bad question is the question you dont ask!
I have my spreadsheet with lots of lovely data being pulled into it from my sexy SQL databases using ODBC connex.
I move the spreadsheet to a friends pc who does not have the same odbc connections as I, funnily enough the query falls over. What I need is a piece of coded connection string to my sql server wich is embedded in the VBA.
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=myDSN;Description=myDSNDesc;UID=myUserName;PWD=myUserPassword;APP=Microsoft® Query;WSID=myWSID" _
, Destination:=Range("A1"))
.CommandText = Array("SELECT * " & Chr(13) & "" & Chr(10) & "FROM myTable")
.Refresh BackgroundQuery:=False
End With
any suggestions?
cheers,
Crazypabs
The only bad question is the question you dont ask!