473,386 Members | 1,827 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,386 software developers and data experts.

Access Caching data?

Hi,

I have a bit of c# code that needs to pull data fro a database, the
problem I have is that once I have run the query once get the same
data, regardless of wether I add update or delete the data in between
calls, annoyed by this I created some simple test code with a simple
database that has 1 table with 2 columns, tableId and Value, the code
is as follows

OleDbConnection cn = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=test.mdb;User Id=admin;Password=;");
cn.Open();
OleDbCommand com = cn.CreateCommand();
com.CommandText = "SELECT TOP 1 Value FROM TEST WHERE TableID =0";
textBox1.Text = com.ExecuteScalar().ToString();

And this still fails, I dont think this is a code issue though, I have
a reasonable amount of experience with access and have never had this
problem before, the only difference I can think of is that I recently
reinstalled my OS and installed a trail version of 2003 so I think it
is more likely to be a configuration issue.

Anyone got any ideas how I can get this working?

Nov 13 '05 #1
1 1855
I really don't do any ADO with Jet -- DAO is the native language of Jet and
it just doesn't make sense to "go the long way 'round". In fact, the only
time I use ADO is when I perform maintenance or implement enhancements on
ADP databases done by someone else. So, I wouldn't even venture to guess
about ADO's caching characteristics.

However, assuming that TableID is your numeric unique identifier field, then
you will retrieve the same identical record each time you execute that
SELECT statement. The TOP 1 has no effect on a SELECT that returns just one
record, and always the same one, as yours appears to do.

"Value", BTW, is not a good choice for a Field Name. It is an Access
reserved word and can cause confusion.

Larry Linson
Microsoft Access MVP
<jo*****@yahoo.co.uk> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Hi,

I have a bit of c# code that needs to pull data fro a database, the
problem I have is that once I have run the query once get the same
data, regardless of wether I add update or delete the data in between
calls, annoyed by this I created some simple test code with a simple
database that has 1 table with 2 columns, tableId and Value, the code
is as follows

OleDbConnection cn = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=test.mdb;User Id=admin;Password=;");
cn.Open();
OleDbCommand com = cn.CreateCommand();
com.CommandText = "SELECT TOP 1 Value FROM TEST WHERE TableID =0";
textBox1.Text = com.ExecuteScalar().ToString();

And this still fails, I dont think this is a code issue though, I have
a reasonable amount of experience with access and have never had this
problem before, the only difference I can think of is that I recently
reinstalled my OS and installed a trail version of 2003 so I think it
is more likely to be a configuration issue.

Anyone got any ideas how I can get this working?

Nov 13 '05 #2

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

Similar topics

2
by: RipTide | last post by:
Background: Using an unsupported/abandoned multi-user multi-database program that uses Access 97 and Jet 3.5. Program itself appears to have been built with PowerBuilder 6.5. Databases reside on...
18
by: Damodar Periwal | last post by:
-------------------------------------------------------------- Software Tree Revs Up JDX OR-Mapper With Innovative And High-Performance Features...
15
by: olle | last post by:
Hi folks. I learning asp.net and compare it with traditional asp and Access-developing. The issue is this one: 1/I have this Ms Acceess adp-project application that works fine on my Ms Sql...
12
by: Paul H | last post by:
Say I have a Windows 2000 server running Terminal Services with a single file Access DB (not front end/back end) on it, could multiple users access the data base simultaneously? Paul
0
by: Martin | last post by:
Hi. I had a very frustrating afternoon and evening but I have got it all under control now so all of a sudden I am in a good mood. I want to share some insights on output caching with you lot. ...
10
by: BillGatesFan | last post by:
I'm trying to understand ASP.NET caching. I set the Page Output directive to VaryByParams= None and the duration = 60. Now whenever users hit my web app they can see each others data. Is there...
5
by: Raj | last post by:
What is the purpose of file system caching while creating a tablespace? Memory on the test server gets used up pretty quickly after a user executes a complex query(database is already activated),...
0
by: Kevin G. Anderson | last post by:
What: CAUG Meeting - Visual Studio 2005 Tools for Office When: Thursday, April 27, 2006, 6PM Who: Jacob Cynamon, Microsoft Where: The Information Management Group 200 W. Monroe St. Suite...
2
by: George1776 | last post by:
All, I've recently upgraded our production ASP.NET/C# application from framework 1.1 to 2.0. Since then I've been plagued by out-of-memory errors and problems with the cache object (which may...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.