sql - Access query called as stored procedure via ADO can't retrieve from linked tables -


i'm trying use vba excel 2007 execute query in access 2007 db stored procedure. query retrieves data few ms sql tables linked via odbc dsn. authentication external tables done windows nt authentication trusted_connection=yes

i have tried connecting linked tables both user , system dsn - either way works fine when run query access 2007.

when try using vba in excel data should coming windows authenticated tables isn't retrieved. able retrieve data set of linked ms sql tables using stored uid.

here connection string i'm using:

strdb = xlwb.path & "\database\dbqueries.accdb" conn.open "provider=microsoft.ace.oledb.12.0;" & _     "data source=" & strdb & ";" 

and here command that's partially successful (with data uid authenticated tables):

with cmd2     .activeconnection = conn     .commandtext = "qryappendtbloutput"     .commandtype = adcmdstoredproc     .parameters.append cmd2.createparameter("[start date]", addbdate, adparaminput, , startdate) end  cmd2.execute 

thanks in advance!

i have been able resolve issue switching access odbc driver instead of ole db provider. changed connection string to:

strdb = xlwb.path & "\database\dbqueries.accdb" conn.open "driver={microsoft access driver (*.mdb, *.accdb)};" & _    "dbq=" & strdb & ";" & _    "trusted_connection=yes;" 

then, had adjust syntax of underlying queries in access meet requirements of driver (i had replace double quotes singles).

thanks reviewed question :)!


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -