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

index searching on Access indexed tables

I am slowing get my head around the concept of treating tables as
collections of rows as vb.net seems to prefer.

However, I have an indexed table in an Access database that I want to scan.

I want to match a certain field but don't want to issue one select statement
for each row in my master table.

I'd rather connect the table to an object and then use a seek or locate
command to get to the correct row that I want.

I can't use a join because it is really slow and an indexed lookup on a
dbtable would be best.

I can't even work out where to start ...

there don't seem to be any methods to cause a dbtable to locate a record
based upon an index item.

can anyone provide some basic VB that I can research further please?

Many thanks all,

jON

Dec 5 '07 #1
5 1358
"jON Rowlan" <jo*******@hotmail.comwrote in
news:Oq**************@TK2MSFTNGP06.phx.gbl:
I am slowing get my head around the concept of treating tables as
collections of rows as vb.net seems to prefer.
ADO does this too.
However, I have an indexed table in an Access database that I want to
scan.

I want to match a certain field but don't want to issue one select
statement for each row in my master table.
You would use a JOIN.
I can't use a join because it is really slow and an indexed lookup on
a dbtable would be best.
A JOIN should use your index if it has been setup correctly.

I can't even work out where to start ...

there don't seem to be any methods to cause a dbtable to locate a
record based upon an index item.
That would be a join :-)

--
sp**********@rogers.com (Do not e-mail)
Dec 5 '07 #2
Jon,

You can use any kind of SQL statement that results to a resultset.

Using that with a datatable will be nothing more then

dim dt as new datatable
dim conn as new oledbconnection(......assuming you know how to do that
dim selectstring as string = "Select blabla from bla where x = y")
dim da as new oledbdataadapter(...........assuming you know how to do that
da.fill(dt)

(using oledbparameters is better, however to show you the sample)

However as you are talking about searching in a datatable, then you have at
least 7 posibilites to find, seek, filter or select what you need and with
much more possibilities then by instance the recordset from the previous
millenium.

Beside that is of course LINQ what is in fact build around this.

The code is completely typed in this message meant as a kind of pseudo code

Cor

Dec 5 '07 #3
Thanks all,

But as I said before, I cannot use a join.

This is because of a quirk of Access that means that adding a simple join to
my already quite complex select statement, the resulting dataset takes ages
and ages to complete. As the MDB I am working with is comes from a third
party I can only read its data I cannot make changes to the way it works,
indexes, table structures or relationships.

A select statement written in Access itself demonstrates the same behaviour
and believe me the select statement is not where the fault lies.

I used to be able to do something like ...

employee.indexname="Primary"
employee.seek "=",112

that is very much cleaner and distinct to me than the 5 lines of code that I
need to execute for each of my master rows.

The above method requires the table to be opened once, closed once, Index
set once and then for each master row I simply need to do a seek and
possibly a NoMatch check (which I would have with whatever method I use).

Am I being advised that this functionality is no longer available?

I don't know what LINQ is I am afraid.

Many thanks all,

jON

"jON Rowlan" <jo*******@hotmail.comwrote in message
news:Oq**************@TK2MSFTNGP06.phx.gbl...
I am slowing get my head around the concept of treating tables as
collections of rows as vb.net seems to prefer.

However, I have an indexed table in an Access database that I want to
scan.

I want to match a certain field but don't want to issue one select
statement
for each row in my master table.

I'd rather connect the table to an object and then use a seek or locate
command to get to the correct row that I want.

I can't use a join because it is really slow and an indexed lookup on a
dbtable would be best.

I can't even work out where to start ...

there don't seem to be any methods to cause a dbtable to locate a record
based upon an index item.

can anyone provide some basic VB that I can research further please?

Many thanks all,

jON
Dec 6 '07 #4
"jON Rowlan" <jo*******@hotmail.comschrieb
I used to be able to do something like ...

employee.indexname="Primary"
employee.seek "=",112
ADO.Net got much worse (slower) in these things. Unfortunatelly nobody cares
because "buy a faster machine" is the answer.
Armin

Dec 6 '07 #5
Hey, I just found out what LINQ is ...

It seems that in developing .NET MS managed to massively overcomplicate even
the simplest of function ...

I mean, where does all this adapter.fill stuff really come from? Whats wrong
with a single recordset you can traverse easily with a few statements ???

So, because it now takes around 20 statements to do what you used to be able
to do with 2, there is a need for a new technology to simplify it all.

And the man for the job is my old friend Anders ...

I'm going back to Delphi - Anders hasn't been there for a while so I still
understand it :-)

seriously though, thanks all, I will use a clunky select statement using
adapters and fill etc etc

jON
"jON Rowlan" <jo*******@hotmail.comwrote in message
news:Oq**************@TK2MSFTNGP06.phx.gbl...
I am slowing get my head around the concept of treating tables as
collections of rows as vb.net seems to prefer.

However, I have an indexed table in an Access database that I want to
scan.

I want to match a certain field but don't want to issue one select
statement
for each row in my master table.

I'd rather connect the table to an object and then use a seek or locate
command to get to the correct row that I want.

I can't use a join because it is really slow and an indexed lookup on a
dbtable would be best.

I can't even work out where to start ...

there don't seem to be any methods to cause a dbtable to locate a record
based upon an index item.

can anyone provide some basic VB that I can research further please?

Many thanks all,

jON
Dec 6 '07 #6

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

Similar topics

3
by: aaj | last post by:
This is a simple question compared to some of the stuff that gets asked (and answered) here, but sometimes its easy to over look the simpler things. I've been working with databases for a few...
0
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
1
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
2
by: Kostas | last post by:
I ve been told from Allen and others that when enforcing referential integrity Access creates a hidden index for the foreign key, therefore, I do not need to re-index it myself. However, I...
10
by: deko | last post by:
I understand it's possible to make a composite Primary Key by holding down the control key and selecting multiple fields, then right-clicking and selecting Primary Key. But I've heard that's not a...
3
by: lauren quantrell | last post by:
In a table design, properties window there is the Indexes/Keys tab. I want to create a few indexes. Row myID is the PK. I also want indexes on rows myOne, myTwo, myThree. In the selected...
18
by: Dave | last post by:
Guys I am really stuck on this one. Any help or suggestions would be appreciated. We have a large table which seemed to just hit some kind of threshold. They query is somewhat responsive when...
0
by: Tawfiq | last post by:
Hi, I have got the following situation please give me some ideas how to solve/work around it. Current situation: Everyday day about 10 million records are processed and bulk inserted in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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...
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?

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.