473,597 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DAO Connectionless Recordset?

Creating a connectionless recordset in ADO is simple enough, but how do
you do it in DAO? I want a recordset stored in memory so I can
filter/sort it easily. If I create a table I can make it work, but I
don't want to have to read/write everything from/to disk every time I
need to use the data.

I tried:

Dim r As DAO.Recordset, tdf As DAO.TableDef

Set tdf = CurrentDb.Creat eTableDef("tmp" , dbHiddenObject)
With tdf.Fields
.Append tdf.CreateField ("TypeID", dbLong)
.Append tdf.CreateField ("Minor_ID", dbLong)

End With

'ERROR 3420 "Object invalid or no longer set"
Set r = tdf.OpenRecords et

r.AddNew
r.Fields("TypeI D") = 1
r.Fields("Minor _ID") = 7
r.Update

r.Close
Set r = Nothing
Set tdf = Nothing

Jul 17 '06 #1
4 11540

darkforcesjedi wrote:
Creating a connectionless recordset in ADO is simple enough, but how do
you do it in DAO? I want a recordset stored in memory so I can
filter/sort it easily. If I create a table I can make it work, but I
don't want to have to read/write everything from/to disk every time I
need to use the data.

I tried:

Dim r As DAO.Recordset, tdf As DAO.TableDef

Set tdf = CurrentDb.Creat eTableDef("tmp" , dbHiddenObject)
With tdf.Fields
.Append tdf.CreateField ("TypeID", dbLong)
.Append tdf.CreateField ("Minor_ID", dbLong)

End With

'ERROR 3420 "Object invalid or no longer set"
Set r = tdf.OpenRecords et

r.AddNew
r.Fields("TypeI D") = 1
r.Fields("Minor _ID") = 7
r.Update

r.Close
Set r = Nothing
Set tdf = Nothing
>From many years ago (the notion is that Transactions will make this
recordset never saved to disk):

Function VirtualDAORecor dSet()
Dim TableName As String
Dim Counter As Long
Dim Rcs As DAO.Recordset
With DBEngine
.BeginTrans
With .Workspaces(0)( 0)
On Error GoTo CreateTableErr:
TableName = "tblTemp" & CStr(Counter)
.Execute "CREATE TABLE " & TableName & "(fldHolida y TEXT
CONSTRAINT AlphaHoliday UNIQUE);"
Set Rcs = .OpenRecordset( TableName, dbOpenTable)
With Rcs
.AddNew
.Fields("fldHol iday") = "Xerxes Day"
.Update
.AddNew
.Fields("fldHol iday") = "Anaximande r Day"
.Update
.AddNew
.Fields("fldHol iday") = "Plato Day"
.Update
.Index = "AlphaHolid ay"
.MoveFirst
MsgBox .Fields("fldHol iday") 'Anixamder Day
.MoveNext
MsgBox .Fields("fldHol iday") 'Plato Day
.MoveLast
MsgBox .Fields("fldHol iday") 'Xerxes Day
.Close
End With
End With
End With
VirtualDAORecor dSetExit:
Set Rcs = Nothing
DBEngine.Rollba ck
Exit Function
CreateTableErr:
With Err
If .Number = 3010 Then
Counter = Counter + 1
TableName = "tblTemp" & CStr(Counter)
Resume
Else
MsgBox .Number & " " & .Description
Resume VirtualDAORecor dSetExit
End If
End With
End Function

Jul 17 '06 #2
"darkforcesjedi " <an************ @pgnmail.comwro te in
news:11******** **************@ m73g2000cwd.goo glegroups.com:
Creating a connectionless recordset in ADO is simple enough, but
how do you do it in DAO?
No. Disconnected recordsets do not exist in DAO and probably never
will. You have to use a table or a transaction (on real tables that
is then rolled back).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jul 17 '06 #3
On 17 Jul 2006 09:05:10 -0700, "Lyle Fairfield"
<ly***********@ aim.comwrote:

Anaximander? That's kind-a obscure. Scolars don't even agree on his
birth year, let alone birth date. And no women in the list (or did you
just provide a fragment of your code)?
Your transaction idea is just as obscure. It probably works, but would
you want it to?

-Tom.

>
darkforcesje di wrote:
>Creating a connectionless recordset in ADO is simple enough, but how do
you do it in DAO? I want a recordset stored in memory so I can
filter/sort it easily. If I create a table I can make it work, but I
don't want to have to read/write everything from/to disk every time I
need to use the data.

I tried:

Dim r As DAO.Recordset, tdf As DAO.TableDef

Set tdf = CurrentDb.Creat eTableDef("tmp" , dbHiddenObject)
With tdf.Fields
.Append tdf.CreateField ("TypeID", dbLong)
.Append tdf.CreateField ("Minor_ID", dbLong)

End With

'ERROR 3420 "Object invalid or no longer set"
Set r = tdf.OpenRecords et

r.AddNew
r.Fields("TypeI D") = 1
r.Fields("Minor _ID") = 7
r.Update

r.Close
Set r = Nothing
Set tdf = Nothing
>>From many years ago (the notion is that Transactions will make this
recordset never saved to disk):

Function VirtualDAORecor dSet()
Dim TableName As String
Dim Counter As Long
Dim Rcs As DAO.Recordset
With DBEngine
.BeginTrans
With .Workspaces(0)( 0)
On Error GoTo CreateTableErr:
TableName = "tblTemp" & CStr(Counter)
.Execute "CREATE TABLE " & TableName & "(fldHolida y TEXT
CONSTRAINT AlphaHoliday UNIQUE);"
Set Rcs = .OpenRecordset( TableName, dbOpenTable)
With Rcs
.AddNew
.Fields("fldHol iday") = "Xerxes Day"
.Update
.AddNew
.Fields("fldHol iday") = "Anaximande r Day"
.Update
.AddNew
.Fields("fldHol iday") = "Plato Day"
.Update
.Index = "AlphaHolid ay"
.MoveFirst
MsgBox .Fields("fldHol iday") 'Anixamder Day
.MoveNext
MsgBox .Fields("fldHol iday") 'Plato Day
.MoveLast
MsgBox .Fields("fldHol iday") 'Xerxes Day
.Close
End With
End With
End With
VirtualDAOReco rdSetExit:
Set Rcs = Nothing
DBEngine.Rollba ck
Exit Function
CreateTableErr :
With Err
If .Number = 3010 Then
Counter = Counter + 1
TableName = "tblTemp" & CStr(Counter)
Resume
Else
MsgBox .Number & " " & .Description
Resume VirtualDAORecor dSetExit
End If
End With
End Function
Jul 18 '06 #4

Tom van Stiphout wrote:
On 17 Jul 2006 09:05:10 -0700, "Lyle Fairfield"
<ly***********@ aim.comwrote:

Anaximander? That's kind-a obscure. Scolars don't even agree on his
birth year, let alone birth date. And no women in the list (or did you
just provide a fragment of your code)?
Your transaction idea is just as obscure. It probably works, but would
you want it to?
So sorry ... it was a typo for Anixemenes.

I don't think I'd want to. I have used temporary tables within
transactions when dealing with some ghastly non-normalized genealogical
tables where the calculations were very intensive ... follwing back
parents; to simplify this I created the temp tables, indexed them and
scanned through them, writing and ftping up html files for each person
.... I do think this simplified things by giving me two or three
standard tables that were designed just for this modules needs. By
indexing these I could find a son/daughter/second wife/whatever pdq ...
even counting creating the tables and indexes the thing ran several
hundred times faster than using the disorganized data. Of course the
tables were never saved ...also of course, Access itself had no
knowledge of them, even during their existence.

Jul 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1956
by: gary artim | last post by:
Hi All, I have a problem using DBIx::RecordSet. I get correct results but continue to get these messages on stderr. I looked at Compat.pm and it seems to be pointing out a problem with my call to Setup. Could anyone (much thanks) shed some light on my tired eyes? See below... Gary code sample:
4
3081
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use the recordset to loop thru the recordset, update values from the recordset and then update the database by passing parmeters to another stored procedure. I would like to use the recordset object but can it be used to pass a parameter to a stored...
0
1117
by: Andy | last post by:
Hi All, Im creating a connectionless udp server and client using the Async method of the Socket class, ie. this.m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); Is there any way of capturing the IPAddress/Port of the sending client? I have tried using the SendTo and Socket.BeginReceiveFrom although still having no joy. I really need to get the sending client ipaddress so I know how to respond to...
19
9305
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not recognise datasets and requires a recordset. Can the datatypes be converted? At the Classic ASP end or .NET end? Can SOAP toolkit provide the conversion, can any toolkit provide a conversion? ...
6
6530
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query works fine, but passing the resulting recordset back to the sub's caller is not working out.
36
4446
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a dataview with a count = 0. Can someone explain why and how I might work around this problem? Here is the code for my function: Public Shared Function GetViewFromRS(ByVal pRS As ADODB.Recordset) _ As DataView
0
8990
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the Recordset? Does the Recordset support Bookmarks? Can we use the Find and/or Seek Methods with this Recordset? Does the Recordset support the use of Indexes? Will the Absoluteposition property be able to be used on this Recordset? etc....
6
5159
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I have created an ADODB.Recordset in the reports OPEN event, built the necessary records inside of it, and then bound the report to this newly created recordset. Here's the rub:
2
5505
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my results page. - Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code): SELECT * FROM db_name WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
0
7886
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8381
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8035
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6688
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3886
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3927
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.