| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |
|

09-25-06, 15:41
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 145
|
|
|
Using ADO with Access reports
|
|
I am using Access 2003 as a front end to a SQL Server 2005 Express database. My plan is to use ADO code for all interaction between the front end and back end. Is there any way to use an ADO recordset as the recordsource of an Access report?
I found one example but what it did was create a local temporary table and set the report recordsource to that temp table. It doesn't actually use ADO, but uses parts of the ADO connection/recordset to create the temporary table.
Thanks for any replies.
BTW - Is the dbforum search feature broke? I found one post asking about it, but there was no response.
|
|

09-25-06, 15:46
|
|
Grand Poobah
|
|
Join Date: Sep 2003
Location: MI
Posts: 3,713
|
|
Nope ... Cannot do ... Access Reports can be bound to stored procs, tables, or set programmatically ... Can't be bound to an ADO recordset.
__________________
Back to Access ... ADO is not the way to go for speed ...
|
|

09-25-06, 16:02
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
|
|
For sub reports I will write to a temp table. Otherwise I use pass through queries.
The source of the problem (as I understand it) is that a recordset is simply a cursor (a load of pointers to individual records) whereas reports require sets of data (for groupings and aggregations). Hopefully one day this problem will be sorted out.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
|
|
|

09-25-06, 16:07
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 145
|
|
If that is the case then the only thing I can think of is using the ADO recordset to create a temporary table locally in Access and base the report off of that. This is different from the example above in that the example sets up a link to the table and then bases the report off of it.
I've seen some things on pass-through queries but that is not what I'm looking for either.
EDIT - pootle, we were posting at the same time and I didn't see your response.
|
|

09-25-06, 16:35
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 145
|
|
I think what I will do is create sprocs that will provide the data needed for the report. I'll return it to an ADO recordset in Access and then create a local Access temp table based on the recordset and then base the report on the local temp table.
If anyone has any more opinions I'd like to hear them still.
EDIT - another simultaneous post, with Teddy this time 
|
Last edited by gwgeller; 09-25-06 at 16:54.
|

09-25-06, 16:35
|
|
Purveyor of Discontent
|
|
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
|
|
You should be abstracting your data layer with stored procs and views server-side. You lose a good deal of the really neat funcitonality you gain by going with sql express/mssql by pulling direct recordsets. There are design and maintenance considerations for using procs and views instead of raw queries as well. If for some reason your backend changes or the logic behind a query changes but the result set is the same, you don't have to change your front end, only the proc/view.
|
|

09-25-06, 17:14
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
Quote:
|
Originally Posted by gwgeller
I think what I will do is create sprocs that will provide the data needed for the report. I'll return it to an ADO recordset in Access and then create a local Access temp table based on the recordset and then base the report on the local temp table.
|
Sounds good
Quote:
|
Originally Posted by gwgeller
If anyone has any more opinions I'd like to hear them still.
|
I suspect you will eventually find you need a pass through one day - try writing n thousand line recordsets to local tables if you don't believe me.
Partly because of the ADO issue I export most of my reports to Excel now (using a nifty Excel method - CopyFromRecordset). Obviously doesn't work for reports requiring formatting (such as invoices and the like) but the punters can get their hands dirty with the data in Excel and so it has been a popular move.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
|
|
|

09-25-06, 17:41
|
|
Purveyor of Discontent
|
|
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
|
|
Quote:
|
Originally Posted by gwgeller
I think what I will do is create sprocs that will provide the data needed for the report. I'll return it to an ADO recordset in Access and then create a local Access temp table based on the recordset and then base the report on the local temp table.
If anyone has any more opinions I'd like to hear them still.
EDIT - another simultaneous post, with Teddy this time 
|
I don't see the reason for a temp table?
|
|

09-25-06, 18:25
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 145
|
|
pootle, I believe you on the huge recordsets, but mine should be limited. I don't know much about pass through queries but how do you create yours? Do/can you create them dynamically or set them up in the .mdb/.adp file? If I have to store the queries in the .mdb/.adp file that is taking away from the abstraction right? I envisioned having nothing but forms, reports and modules in my front end.
Teddy if I don't use a temp table how would my report access the data?
|
|

09-26-06, 03:11
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
All my data manipulation (crosstabs excluded) is in views and sprocs on the server. My app accesses sprocs only (via pass through queries). A pass through is just a connection and a string of unparsed text sent to the server to execute - it is just about the dummest query there can be.
So - I use pass throughs (created dynamically - there is no other way - you need to programmatically change the SQL if you need to pass parameters) to call sprocs.
Pass throughs do present security holes. You are passing text to the server to execute and the connection string is stored as part of the pass through properties.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
|
|
|

09-26-06, 09:30
|
|
Grand Poobah
|
|
Join Date: Sep 2003
Location: MI
Posts: 3,713
|
|
Quote:
|
Originally Posted by pootle flump
All my data manipulation blah blah blah ...
|
What's up???? What happened to the audacious cuddler of flumps????  Too hoity-toity to associate with us riff-raff??? So, what brought about this change of heart ...
__________________
Back to Access ... ADO is not the way to go for speed ...
|
|

09-26-06, 09:38
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
Quote:
|
Originally Posted by M Owen
So, what brought about this change of heart ...
|
Boredom
Quote:
|
Originally Posted by M Owen
Too hoity-toity to associate with us riff-raff???
|
Yup 
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
|
|
|

09-26-06, 09:42
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
|
|
|

09-26-06, 11:43
|
|
Purveyor of Discontent
|
|
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
|
|
Quote:
|
Originally Posted by gwgeller
pootle, I believe you on the huge recordsets, but mine should be limited. I don't know much about pass through queries but how do you create yours? Do/can you create them dynamically or set them up in the .mdb/.adp file? If I have to store the queries in the .mdb/.adp file that is taking away from the abstraction right? I envisioned having nothing but forms, reports and modules in my front end.
Teddy if I don't use a temp table how would my report access the data?
|
Recordsource = "EXEC sp_MyProc"
|
|

09-26-06, 12:35
|
|
King of Understatement
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
|
|
Quote:
|
Originally Posted by Teddy
Recordsource = "EXEC sp_MyProc"
|
ADP\ ADEs only 
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|