473,412 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

recordset cashing


This worked for a large database (150+ tables):

Do While Not rstLinks.EOF
Set td = DB.TableDefs(rstLinks!Name)
'Debug.Print rstLinks!Name
If InStr(td.Connect, "corpbe.mdb") Then
td.Connect = ";DATABASE=" & strDestDatabase & ";TABLE=" &
rstLinks!Name
td.RefreshLink
End If
rstLinks.MoveNext
Loop

rstLinks is a recordset of a query on MySysObjects

But on a smaller database, it loops indefinately - never reaching .EOD

After much head banging, a possible reason dawned on me - that for a
larger recordset access caches the values - but for a smaller recordset
it doesn't.
Cause of failure: td.RefreshLink - for a cached redordset this is not a
problem, but it really upsets a small recordset being read directly
from MSysObjects. As far as I understand MSysObjects is re-formatted on
a td.RefreshLink - so the recordset loses its place.

1. Does this sound like the reason, or am I reaching - is there a
simpler cause?
2. Is there a way to force Access to cache or not to cache a recordset?

(btw I solved the problem by looping directly through DB.TableDefs()
instead)

Feb 23 '06 #1
3 1933
BillCo wrote:
This worked for a large database (150+ tables):

Do While Not rstLinks.EOF
Set td = DB.TableDefs(rstLinks!Name)
'Debug.Print rstLinks!Name
If InStr(td.Connect, "corpbe.mdb") Then
td.Connect = ";DATABASE=" & strDestDatabase & ";TABLE=" &
rstLinks!Name
td.RefreshLink
End If
rstLinks.MoveNext
Loop

rstLinks is a recordset of a query on MySysObjects

But on a smaller database, it loops indefinately - never reaching .EOD

After much head banging, a possible reason dawned on me - that for a
larger recordset access caches the values - but for a smaller recordset
it doesn't.
Cause of failure: td.RefreshLink - for a cached redordset this is not a
problem, but it really upsets a small recordset being read directly
from MSysObjects. As far as I understand MSysObjects is re-formatted on
a td.RefreshLink - so the recordset loses its place.

1. Does this sound like the reason, or am I reaching - is there a
simpler cause?
2. Is there a way to force Access to cache or not to cache a recordset?

(btw I solved the problem by looping directly through DB.TableDefs()
instead)


Here's some code that loops thru the tables. Let's say you have 100
tables. Let's find out if there is a loop. Break on count 150
Dim tdf As TableDef
Dim i As Integer
For Each tdf In CurrentDb.TableDefs
If Left(tdf.name, 4) <> "MSys" Then
i = i + 1
Debug.Print tdf.name
If i > 150 then exit for
End If
Next
MsgBox "done " & i

I am excluding system tables. Who knows, maybe some odd table has
"corpbe.mdb" in the name. Maybe a table in rstLinks is your culprit.
Feb 23 '06 #2
You would solve the problem by opening a snapshot, instead
of a table-type recordset. So that changes in the table
where not reflected in the snapshot.

But I see that you have a better solution.

(david)

"BillCo" <co**********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

This worked for a large database (150+ tables):

Do While Not rstLinks.EOF
Set td = DB.TableDefs(rstLinks!Name)
'Debug.Print rstLinks!Name
If InStr(td.Connect, "corpbe.mdb") Then
td.Connect = ";DATABASE=" & strDestDatabase & ";TABLE=" &
rstLinks!Name
td.RefreshLink
End If
rstLinks.MoveNext
Loop

rstLinks is a recordset of a query on MySysObjects

But on a smaller database, it loops indefinately - never reaching .EOD

After much head banging, a possible reason dawned on me - that for a
larger recordset access caches the values - but for a smaller recordset
it doesn't.
Cause of failure: td.RefreshLink - for a cached redordset this is not a
problem, but it really upsets a small recordset being read directly
from MSysObjects. As far as I understand MSysObjects is re-formatted on
a td.RefreshLink - so the recordset loses its place.

1. Does this sound like the reason, or am I reaching - is there a
simpler cause?
2. Is there a way to force Access to cache or not to cache a recordset?

(btw I solved the problem by looping directly through DB.TableDefs()
instead)

Feb 24 '06 #3
i've sloved the problem ok, looping through TableDefs() - you dont need
the i > 150 thingy, "for each in" covers it.

the question is really about recordset caching...

Feb 24 '06 #4

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

Similar topics

0
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...
4
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...
19
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...
6
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...
1
by: vaidas gudas | last post by:
I am cashing tge asp.net page for duration=600 and varybyparam="ID". In this page is the table, which binding the data from the sqlserver. when data is modifikated using this page he showing the...
36
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...
0
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...
6
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...
2
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
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...
0
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 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.