473,404 Members | 2,178 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,404 software developers and data experts.

read/write loop MS Access

Hi,

Hope you can help - I can't see the wood for the trees any more.

I currently have a local MS Access file.

I'd like to do this in VB.NET:

connect to file (select * from table)
for each row in table
if TEST(row) then
remove row
else
increment a field
end if
end for

The success/failure of the TEST function is only partly dependent of
the row's contents (so we can't use the SQL UPDATE command).
The MDB file may contain thousands of rows (so, I'd like to avoid
reading it all into memory at once)

Can someone please point me in the right direction?

Thanks,
Kevin

Feb 19 '07 #1
5 4589
"kevin" <ke*************@gmail.comschrieb
Hi,

Hope you can help - I can't see the wood for the trees any more.

I currently have a local MS Access file.

I'd like to do this in VB.NET:

connect to file (select * from table)
for each row in table
if TEST(row) then
remove row
else
increment a field
end if
end for

The success/failure of the TEST function is only partly dependent of
the row's contents (so we can't use the SQL UPDATE command). The MDB
file may contain thousands of rows (so, I'd like to avoid reading it
all into memory at once)

Can someone please point me in the right direction?
Don't know what exactly the problem is, so this is a good place to start:

http://msdn2.microsoft.com/en-us/library/e80y5yhx.aspx
http://msdn2.microsoft.com/en-us/library/ms254937.aspx
http://msdn2.microsoft.com/en-us/library/ms254950.aspx

(not part of the MSDN TOC anymore (why?))

Further, language unrelated and ADO.Net related question fit best here:
microsoft.public.dotnet.framework.adonet
Armin

Feb 19 '07 #2
(not part of the MSDN TOC anymore (why?))
Maybe because Access has been declared obsolete as DB backend for
applications for a while

regards

Michel
"Armin Zingler" <az*******@freenet.deschreef in bericht
news:eE*************@TK2MSFTNGP04.phx.gbl...
"kevin" <ke*************@gmail.comschrieb
>Hi,

Hope you can help - I can't see the wood for the trees any more.

I currently have a local MS Access file.

I'd like to do this in VB.NET:

connect to file (select * from table)
for each row in table
if TEST(row) then
remove row
else
increment a field
end if
end for

The success/failure of the TEST function is only partly dependent of
the row's contents (so we can't use the SQL UPDATE command). The MDB
file may contain thousands of rows (so, I'd like to avoid reading it
all into memory at once)

Can someone please point me in the right direction?

Don't know what exactly the problem is, so this is a good place to start:

http://msdn2.microsoft.com/en-us/library/e80y5yhx.aspx
http://msdn2.microsoft.com/en-us/library/ms254937.aspx
http://msdn2.microsoft.com/en-us/library/ms254950.aspx

(not part of the MSDN TOC anymore (why?))

Further, language unrelated and ADO.Net related question fit best here:
microsoft.public.dotnet.framework.adonet
Armin

Feb 19 '07 #3
"Michel Posseth [MCP]" <MS**@posseth.comschrieb
(not part of the MSDN TOC anymore (why?))


Maybe because Access has been declared obsolete as DB backend for
applications for a while
:-) The link goes to the ADO.Net docs. I guess it still exits.
Armin
Feb 19 '07 #4
On 2007-02-19 06:23:13 +0000, "Michel Posseth [MCP]" <MS**@posseth.comsaid:
>(not part of the MSDN TOC anymore (why?))


Maybe because Access has been declared obsolete as DB backend for
applications for a while
Could anyone advise on a suitable backend then?

My VB.NET app will generate "tasks" to perform, and perform them. If it
can't do them for some reason, it needs to store them, and retry later.
Each task will have an "attempts field", which will be incremented on
each attempt. There could be thousands of tasks at any one time.

I'd like to process these tasks in a seperate thread, which:

1) avoids reading the whole list of uncompleted tasks into memory at once.
2) doesn't involve installing separate products onto the system (but I
can include files in my installation). I assume .NET Framework 2.

Thanks,
Kevin

>

"Armin Zingler" <az*******@freenet.deschreef in bericht
news:eE*************@TK2MSFTNGP04.phx.gbl...
>"kevin" <ke*************@gmail.comschrieb
>>Hi,

Hope you can help - I can't see the wood for the trees any more.

I currently have a local MS Access file.

I'd like to do this in VB.NET:

connect to file (select * from table)
for each row in table
if TEST(row) then
remove row
else
increment a field
end if
end for

The success/failure of the TEST function is only partly dependent of
the row's contents (so we can't use the SQL UPDATE command). The MDB
file may contain thousands of rows (so, I'd like to avoid reading it
all into memory at once)

Can someone please point me in the right direction?

Don't know what exactly the problem is, so this is a good place to start:

http://msdn2.microsoft.com/en-us/library/e80y5yhx.aspx
http://msdn2.microsoft.com/en-us/library/ms254937.aspx
http://msdn2.microsoft.com/en-us/library/ms254950.aspx

(not part of the MSDN TOC anymore (why?))

Further, language unrelated and ADO.Net related question fit best here:
microsoft.public.dotnet.framework.adonet
Armin

Feb 19 '07 #5
Kevin,

In my idea are you asking two conflicting questions at ones.

How can I do this with Select * from table
How can I avoid that I read all data at once.

For the first question you can use an SQLExpress server. Works almost
equally to the Jet engine which is used in MS Access if you would OleDB, but
you would be stupid to do that better is SQLClient.

The second is that you can use a datareader and make your own SQL delete and
update statement.
if TEST(row) then
execute.nonquery with "Delete statement" remove row
else
increment a field execute.nonQuery(with update statement)
end if
end for
I hope this helps,

Cor
"kevin" <ke*************@gmail.comschreef in bericht
news:2007021900451075249-kevsoutN0Spam@gmailcom...
Hi,

Hope you can help - I can't see the wood for the trees any more.

I currently have a local MS Access file.

I'd like to do this in VB.NET:

connect to file (select * from table)
for each row in table
if TEST(row) then
remove row
else
increment a field
end if
end for

The success/failure of the TEST function is only partly dependent of the
row's contents (so we can't use the SQL UPDATE command).
The MDB file may contain thousands of rows (so, I'd like to avoid reading
it all into memory at once)

Can someone please point me in the right direction?

Thanks,
Kevin

Feb 19 '07 #6

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

Similar topics

11
by: HolaGoogle | last post by:
hi all, can you please tell me what i should do to avoid session timeout when displaying my database info in my asp form (DisplayUserDatabase.asp)??? ** actualy it does load and display the...
9
by: Randell D. | last post by:
Folks, I can program fairly comfortably in PHP and can, for the most part using these skills and others that I've picked up over the years manage to read/understand most code in Javascript... so...
2
by: dumboo | last post by:
hi there i m using fstream object for reading through and writing to my file, using following code char c; while(!m_aa.eof()) { m_aa.read(&c, sizeof(c)); m_oo.write(&c, sizeof(c));
22
by: Jason Heyes | last post by:
Does this function need to call eof after the while-loop to be correct? bool read_file(std::string name, std::string &s) { std::ifstream in(name.c_str()); if (!in.is_open()) return false; ...
2
by: John Fred | last post by:
I have created a XML File With XmlTextWriter and the result is : <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Configuration> <Settings> <DbName>DoxWork</DbName>...
5
by: John Dumais | last post by:
Hello, I have been trying to figure out how to write an array of doubles (in this specific case) to a binary stream without using a loop. What I have been doing is... foreach(double d in...
35
by: Shyguy | last post by:
Is it possible, and if so how would I read and import folder names from a CD to a table? Thank you for any help.
3
by: Ryan Liu | last post by:
Hi, What does ArrayList.Synchronized really do for an ArrayList? Is that equal to add lock(this) for all its public methods and properties? Not just for Add()/Insert()/Remvoe()/Count, but also...
0
by: Arvi Laanemets | last post by:
Hi We are trying to create a simply ASP code, which creates guests list from Access database, and displays a country flag for every guest. All flag images are stored as *.gif in subfolder...
3
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I am trying to loop a Textfile. This Textfile is located on a shared drive and it is used by another process. When I try to read it I get an exeption: The process cannot access the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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,...
0
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...

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.