Retrieve SQLServer Data into an Access ListBox

  • Thread starter Thread starter Lionel M.
  • Start date Start date
L

Lionel M.

Hi,

I'm using an .mdb Access Frontend to connect to a SQL
Server database. I'm using ADO to retrive data!

I'm wondering what I can do to retrive some SQLServer
data into an Access ListBox control.

Thank you,

Lionel M.
 
About the best solution is to simply create a view on the sql side. Then,
create a link to this view on the front end. You then simply use this linked
table to the view for the source of the listbox. This works quite well, and
eliminates all the code to load up a reocrdset.

I don't really see why you want to write a whole bunch of code and load up a
recordset, and then take that recordset and send it to the listbox (the
listbox in ms-access can't use a reocrdset as its source.

However, you can certanly use sql strings for the souce of the listbox, but
anything that has joins in it should thus be moved to the sql side as a
view.

You can certainly go to all the trouble to load up a reocrdset, and then use
that recordset as the source for the listbox, but I don't see the need to
spend all that coding time to do that. The code to do this can be a bit
messy. If you must, here is a link as how you can use a call back function
to fill the list box.

http://www.mvps.org/access/forms/frm0049.htm
 
Back
Top