sql server - Using Excel VBA to run SQL query and getting error -


i new vba. run simple sql query vba code. found simple looking code task, keep getting error
"automation error unspecified error 2147647259 (80004005)"
stuck, please (user name , password masked). here code:

sub download_standard_bom()   dim cnn new adodb.connection   dim rst new adodb.recordset   dim connectionstring string   dim strquery string       connectionstring = "provider=sqloledb.1;password=13139797mmn;persist   security info=true;user id=mpam;data source=172.20.84.15;use procedure   prepare=1;auto translate=true;packet size=4096;use encryption   data=false;tag column collation when possible=false;initial   catalog=importhapoalim"       cnn.open connectionstring         cnn.commandtimeout = 900         strquery = "select max(cast(itra float)) [importhapoalim].[dbo].[minchali] deltaid = 275"          rst.open strquery, cnn         sheets(1).range("a2").copyfromrecordset rst    end sub 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -