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

SELECTing Records Into an Array Variable ???

There's an old database system called "PICK" - still in use in
various forms such as 'OpenQM' - wherein you can SELECT or READ
directly into an array variable. For example :

"SELECT * FROM DemoTable TO ArrayVar"

- stuffs ArrayVar with every record in DemoTable in a format :

ArrayVar[0][0...nFieldsInDemoTable]
ArrayVar[1][0...nFieldsInDemoTable]
ArrayVar[2][0...nFieldsInDemoTable]
Oct 30 '08 #1
4 8867
Arrays and Recordsets are pretty much the same thing. A recordset is
just an array with a ton of properties. Sql is way more efficient than
Recordsets for processing table data. How clean sql is kind of depends
on one's level of proficiency with the language. Less experienced sql
users write lengthy queries where someone who has been using sql for a
few years with usually write very short sql queries which perform a ton
more operations.

What is your goal with the arrays?
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Oct 30 '08 #2
On Oct 30, 10:24*am, b...@barrk.net (Blackwater) wrote:
There's an old database system called "PICK" - still in use in
various forms such as 'OpenQM' - wherein you can SELECT or READ
directly into an array variable. For example :

* *"SELECT * FROM DemoTable TO ArrayVar"

- stuffs ArrayVar with every record in DemoTable in a format :

* *ArrayVar[0][0...nFieldsInDemoTable]
* *ArrayVar[1][0...nFieldsInDemoTable]
* *ArrayVar[2][0...nFieldsInDemoTable]
* *.
* *.
* *ArrayVar[n][0...nFieldsInDemoTable]

(actually PICK is a 'multivalue' DB/OS, so there could be n-dimensions
to each individual field above and beyond this basic structure, ie :
ArrayVar[17][5][222][8][etc...] *)

Anyway, this way of handling a SELECT is very powerful and handy,
allowing you to immediately access every selected record and its
individual fields in code as an ordinary array of variants. If
you processed the array, you could then write it back to 'DemoTable'
without much hassle.

Now the big question is whether Access can be made to do something
like this in an unclumsy manner. I know you can SELECT into a new
table ... but then you're stuck using the one-at-a-time back-n-forth
approach of accessing/manipulating each record, so you may as well
not SELECT into a new table at all. The 'option' here is to SELECT
in the ordinary way and then code a loop of MoveNexts and copy each
field into an array ... but it's a lot cleaner if SELECT can do it
all by itself.

Any info helpful.
I sympathize, but VBA doesn't provide what you're looking for. If all
you're doing is lookups, the domain functions like DLOOKUP are easy to
use. VBA only offers scalar processing on arrays, so you'd be doing
one at a atime, back and forth processing on them, anyway.

The recordset MOVE method allows you to move a specified number of
records forward or back. Recordsets have the AbsolutePosition
property, which lets you go to a specific ordinal record number, if
the provider supports it. You can reference fields by their ordinal
position rather than name, if that helps.
Oct 30 '08 #3
"the big question is whether Access can be made to do something like
this in an unclumsy manner"
Can Access do anything in an un-clumsy manner?

You want to use VBA arrays? Is this a form of self-punishment? You
want to screw up an application? Over-heat your CPU? What?

OK if you gotta you gotta, Have you checked out GetRows()?
On Oct 30, 10:24*am, b...@barrk.net (Blackwater) wrote:
There's an old database system called "PICK" - still in use in
various forms such as 'OpenQM' - wherein you can SELECT or READ
directly into an array variable. For example :

* *"SELECT * FROM DemoTable TO ArrayVar"

- stuffs ArrayVar with every record in DemoTable in a format :

* *ArrayVar[0][0...nFieldsInDemoTable]
* *ArrayVar[1][0...nFieldsInDemoTable]
* *ArrayVar[2][0...nFieldsInDemoTable]
* *.
* *.
* *ArrayVar[n][0...nFieldsInDemoTable]

(actually PICK is a 'multivalue' DB/OS, so there could be n-dimensions
to each individual field above and beyond this basic structure, ie :
ArrayVar[17][5][222][8][etc...] *)

Anyway, this way of handling a SELECT is very powerful and handy,
allowing you to immediately access every selected record and its
individual fields in code as an ordinary array of variants. If
you processed the array, you could then write it back to 'DemoTable'
without much hassle.

Now the big question is whether Access can be made to do something
like this in an unclumsy manner. I know you can SELECT into a new
table ... but then you're stuck using the one-at-a-time back-n-forth
approach of accessing/manipulating each record, so you may as well
not SELECT into a new table at all. The 'option' here is to SELECT
in the ordinary way and then code a loop of MoveNexts and copy each
field into an array ... but it's a lot cleaner if SELECT can do it
all by itself.

Any info helpful.
Oct 30 '08 #4
On Oct 30, 6:39*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
"the big question is whether Access can be made to do something like
this in an unclumsy manner"
Can Access do anything in an un-clumsy manner?

You want to use VBA arrays? Is this a form of self-punishment? You
want to screw up an application? Over-heat your CPU? What?

OK if you gotta you gotta, Have you checked out GetRows()?

On Oct 30, 10:24*am, b...@barrk.net (Blackwater) wrote:
There's an old database system called "PICK" - still in use in
various forms such as 'OpenQM' - wherein you can SELECT or READ
directly into an array variable. For example :
* *"SELECT * FROM DemoTable TO ArrayVar"
- stuffs ArrayVar with every record in DemoTable in a format :
* *ArrayVar[0][0...nFieldsInDemoTable]
* *ArrayVar[1][0...nFieldsInDemoTable]
* *ArrayVar[2][0...nFieldsInDemoTable]
* *.
* *.
* *ArrayVar[n][0...nFieldsInDemoTable]
(actually PICK is a 'multivalue' DB/OS, so there could be n-dimensions
to each individual field above and beyond this basic structure, ie :
ArrayVar[17][5][222][8][etc...] *)
Anyway, this way of handling a SELECT is very powerful and handy,
allowing you to immediately access every selected record and its
individual fields in code as an ordinary array of variants. If
you processed the array, you could then write it back to 'DemoTable'
without much hassle.
Now the big question is whether Access can be made to do something
like this in an unclumsy manner. I know you can SELECT into a new
table ... but then you're stuck using the one-at-a-time back-n-forth
approach of accessing/manipulating each record, so you may as well
not SELECT into a new table at all. The 'option' here is to SELECT
in the ordinary way and then code a loop of MoveNexts and copy each
field into an array ... but it's a lot cleaner if SELECT can do it
all by itself.
Any info helpful.- Hide quoted text -

- Show quoted text -
Wow, that's wild. Never knew you could do that.
Oct 31 '08 #5

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

Similar topics

1
by: M Wells | last post by:
Hi All, Sorry if the subject line is too obscure -- I couldn't think of a way of describing this request. I have a table that contains approximately 1 million records. I want to be able to...
18
by: booner | last post by:
I have a form that when it loads I would like to highlight the values (from a DB) that have been selected in a multiple selection list (<select multiple="true">. function onLoad() {...
2
by: Chris Belcher | last post by:
While I'm sure this is simple I just can't figure it out. Table A (assignments) is on the One side of a One to Many relationship With Table B (assignees)There are many assignees assigned the one...
1
by: Ramesh | last post by:
hi, I am selecting fields from three table for manupulating data and i want to display total number of records selected. But i am always getting -1 value, eventhough 1000 of records are selected....
2
by: Catch_22 | last post by:
Hi, I have a stored procedure that has to extract the child records for particular parent records. The issue is that in some cases I do not want to extract all the child records only a...
2
by: larry | last post by:
I am working on a DB for family data, and in this application the data spans variable amount of rows in multiple tables (one for the adults data, one for "family", one for the kids, another for...
5
by: megahurtz | last post by:
I need to put together an SQL statement and I can't think of how to make it work properly. The scenario is that I have news items in a database that have a launch time and can optionally have an...
0
by: Rich P | last post by:
Now your question makes a lot more sense. It sounds like you want to be able to drag a group of records - say - from a subform and drop it into some control for further processing. This kind of...
5
by: hollyquinn | last post by:
Hi I am working with a web application where I am selecting values from a SQL Server 2005 database and then loading the values into different controls on my page. Most of the values load with no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.