sql - Select query to Access from VBA not returning duplicate values -


any issue appreciated.

i trying retrieve access, means of select, multiple values same id , have pasted excel sheet. running code excel vba.

the query using retrieve said values is:

select role  roles  app_id=(select id apps name='app name'); 

which assigned variable , afterwards executed using set variable = cn.execute(variable). problem query, executed excel vba, returns first value found. now, if run query access returns every value id specified app.

i have tried tried using inner join, in, having, etc. wont retrieve of values excel. said, query works fine when used in access know must limitation in excel.

thank guys can provide.

assuming using adodb in excel, keep in mind execute function returns recordset. can loop through recordset see additional rows.

set rng = activesheet.range("a2") set rst = cn.execute(strsql)  rst     while not .eof         rng = cstr(!role)         set rng = rng.offset(1)         .movenext     loop end 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -