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 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
"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/
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
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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:
|
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...
|
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...
|
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?
...
|
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.
| |
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
|
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....
|
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:
|
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%’)
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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();...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |