Having just re-read Adezii's article on the above subject, I thought I'd have a play.
I think there must be a "Reference" that I need to set to use ADODB.Recordset? Otherwise I get a "User-defined type not defined" error.
Jim
7 1856
Try the "Microsoft AcitveX Data Objects" library.
It's selected by default from A2000 or A2003...
Nic;o)
Having just re-read Adezii's article on the above subject, I thought I'd have a play.
I think there must be a "Reference" that I need to set to use ADODB.Recordset? Otherwise I get a "User-defined type not defined" error.
Jim
You need a reference to ...
Microsoft ActiveX Data Objects 2.X library
Microsoft ADO Ext. 2.X for DDL and Security
You need a reference to ...
Microsoft ActiveX Data Objects 2.X library
Microsoft ADO Ext. 2.X for DDL and Security
Thank you both. (Each individually and together (Dang 20 character limit))
Jim
Thank you both. (Each individually and together (Dang 20 character limit))
Jim
You're welcome.
Having just re-read Adezii's article on the above subject, I thought I'd have a play.
<Snip>
Jim
OK, I'm all Referenced up and playing, one of the immediate uses I thought of was to store a recordset as it was at a particular date and then re-use it even if the data in the database had changed.
when I try the following... - Private Sub Report_Open(Cancel As Integer)
-
Dim rsSample As ADODB.Recordset
-
Dim strFile As String
-
-
Set rsSample = New ADODB.Recordset
-
-
'Construct a file name to use
-
strFile = CurrentProject.Path & "\Sample.adtg"
-
-
'Make sure the file exists
-
If Len(Dir(strFile)) > 0 Then
-
'Open the recordset from the file
-
rsSample.Open strFile, , adOpenDynamic, adLockOptimistic
-
'Reconnect the recordset to the database
-
rsSample.ActiveConnection = CurrentProject.Connection
-
'Make the recordset the recordsource of this subreport
-
Set Me.Recordset = rsSample
-
End If
-
rsSample.Close
-
Set rsSample = Nothing
-
-
End Sub
which is pretty much the code that Adezii posts (except for the cursor type) I get an error at the
line which says Error 2593, This feature is not available in an MDB.
There ain't nuffin' in the help files for the Recordset property saying it's only for an ADP. Is this a problem because of the ADODB.Recordset or am I missing something?
Jim
OK, I'm all Referenced up and playing, one of the immediate uses I thought of was to store a recordset as it was at a particular date and then re-use it even if the data in the database had changed.
when I try the following... - Private Sub Report_Open(Cancel As Integer)
-
Dim rsSample As ADODB.Recordset
-
Dim strFile As String
-
-
Set rsSample = New ADODB.Recordset
-
-
'Construct a file name to use
-
strFile = CurrentProject.Path & "\Sample.adtg"
-
-
'Make sure the file exists
-
If Len(Dir(strFile)) > 0 Then
-
'Open the recordset from the file
-
rsSample.Open strFile, , adOpenDynamic, adLockOptimistic
-
'Reconnect the recordset to the database
-
rsSample.ActiveConnection = CurrentProject.Connection
-
'Make the recordset the recordsource of this subreport
-
Set Me.Recordset = rsSample
-
End If
-
rsSample.Close
-
Set rsSample = Nothing
-
-
End Sub
which is pretty much the code that Adezii posts (except for the cursor type) I get an error at the
line which says Error 2593, This feature is not available in an MDB.
There ain't nuffin' in the help files for the Recordset property saying it's only for an ADP. Is this a problem because of the ADODB.Recordset or am I missing something?
Jim
Just subscribing for now, but I'll definately drop in later and hopefully we'll get this ironed out.
OK, I'm all Referenced up and playing, one of the immediate uses I thought of was to store a recordset as it was at a particular date and then re-use it even if the data in the database had changed.
when I try the following... - Private Sub Report_Open(Cancel As Integer)
-
Dim rsSample As ADODB.Recordset
-
Dim strFile As String
-
-
Set rsSample = New ADODB.Recordset
-
-
'Construct a file name to use
-
strFile = CurrentProject.Path & "\Sample.adtg"
-
-
'Make sure the file exists
-
If Len(Dir(strFile)) > 0 Then
-
'Open the recordset from the file
-
rsSample.Open strFile, , adOpenDynamic, adLockOptimistic
-
'Reconnect the recordset to the database
-
rsSample.ActiveConnection = CurrentProject.Connection
-
'Make the recordset the recordsource of this subreport
-
Set Me.Recordset = rsSample
-
End If
-
rsSample.Close
-
Set rsSample = Nothing
-
-
End Sub
which is pretty much the code that Adezii posts (except for the cursor type) I get an error at the
line which says Error 2593, This feature is not available in an MDB.
There ain't nuffin' in the help files for the Recordset property saying it's only for an ADP. Is this a problem because of the ADODB.Recordset or am I missing something?
Jim
You are creating and destroying a Recordset Variable (rstSample) before the Report has time to display its data. Aside from this, your mysterious Error will still appear. To complicate matters further, this code, except for declaring rstSample Globally and not closing the Recordset in the Procedure, works flawlessly in a Form's Open() Event. It seems as though it will not work within the context of a Report but don't give up hope, I'll look at it later.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mark Carter |
last post by:
Are there any good ways of persisting/depersisting a Worksheet?
|
by: Chris S. |
last post by:
Out of a somewhat academic interest, I've created a rudimentary module
for persisting dynamically created objects and data structures in plain
Python source code. Presently, it's a little under a...
|
by: Citoyen du Monde |
last post by:
Trying to get some ideas on a simple javascript project (to teach myself the
language).
I want to develop a client-side vocabulary practice application that would
allow users to
enter their own...
|
by: Dave Veeneman |
last post by:
When does serializing objects make more sense than persisting them to a
database? I'm new to object serialization, and I'm trying to get a feel for
when to use it.
Here is an example: I'm...
|
by: lim |
last post by:
What is the possible error that occurs when the Page_load event is not triggered during execution.
In my page there's some basic server control. Is there any loops holes?
|
by: Dave |
last post by:
I'm relatively new to ASP and .NET and having trouble getting my head round
this.
I want to read a datset from a database, and display information from one
row at a time, using a Next and a...
|
by: xenophon |
last post by:
I added a Hidden Form Field to a form in the code behind.
The value is being set in JavaScript client-side, but it is not
persisting to the server in the PostBack.
I know the value is being set...
|
by: Dick |
last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls
GridView.DataBind. I want the row that is selected before the DataBind to
still be selected afterwards.
This happens...
|
by: ADezii |
last post by:
Most Access Users realize that Recordsets, being virtual representations of a Query, Table, or SQL Statement, exist only in our PC's memory. They, and the data they contain, literally exist at one...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |