Method to display ADO.RecordSet query results visually with Access FE (1 Viewer)

mdlueck

Sr. Application Developer
Local time
Today, 00:25
Joined
Jun 23, 2011
Messages
2,631
Greetings,

Some time ago, I was chatting with Galaxiom in this forum system about techniques to use ADO objects as the data source for form controls and not have to use the ADP file format.

For a previous client I worked out a technique to use Access in a Client/Server configuration where multiple records were downloaded into an FE temp table (using a nested DAO.QueryDef technique) and then the form would execute a query to display the contents of the FE temp table. That works well, and makes for a lot of use of DAO objects.

Is there a technique to be able to use ADO objects and perhaps bind form controls directly to those ADO objects which would get around needing to download records into a FE temp table, and utilize DAO objects?

I am looking to build a read-only dashboard front-end to a SQL BE DB. So I would very much like to be able to work with ADO.Command and ADO.Paramenters objects to execute these queries rather than DAO.QueryDef objects. There is no need for this dashboard application to do any updates to the SQL BE DB.

I am thankful,
 

Ranman256

Well-known member
Local time
Today, 00:25
Joined
Apr 9, 2015
Messages
4,337
you dont need to use ADO objects, the access database IS the ADO object.
Just build a query on a table and get the results. No need to build VB code.
 

mdlueck

Sr. Application Developer
Local time
Today, 00:25
Joined
Jun 23, 2011
Messages
2,631
No no no... I want to send pass-through SQL to the BE DB.

Just when I do so, that causes a disconnect between BE / FE such that ADO objects have not directly linked to form controls.

For this read-only dashboard, I am asking again so I might head down another path.

I am seeking a way to bind Access FE form controls to the ADO objects interacting with the SQL BE DB for read-only data display.

I am thankful,
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 14:25
Joined
Jan 20, 2009
Messages
12,853
The Cursor Location must be adUseClient (or 3 if you are using Late Binding).

Set the form's recordset property to the ADO recordset returned by the command object.
 

mdlueck

Sr. Application Developer
Local time
Today, 00:25
Joined
Jun 23, 2011
Messages
2,631
The Cursor Location must be adUseClient (or 3 if you are using Late Binding).

Yes I use late binding, however I have a module which defines all of the constants ADO makes use of, so I will specify the constant name.

Set the form's recordset property to the ADO recordset returned by the command object.

So basically what I last worked out is the method if using ADO objects. The only strange thing I recall is I had to force the height of a multiple items / continuous form else the height automatically would shrink to "around zero". All else appeared to be normal using that Form + ADO objects technique. I will look up the last sample code I had arrived at.

I looked up the prior thread I was referring to. End of that thread starts here:

"Fabricated ADO recordset - adding records"
http://www.access-programmers.co.uk/forums/showthread.php?t=258559&page=2#post1319473

I am thankful,
 
Last edited:

Users who are viewing this thread

Top Bottom