Read a table to an array

J

JattilaB

how can I read a tabel to an arry?
I would like to achive this wiht in a vb code inside the database...?
 
R

Rick B

Please do not multi-post into more than one group.



how can I read a tabel to an arry?
I would like to achive this wiht in a vb code inside the database...?
 
S

Sandra Daigle

Take a look at the GetRows Method (DAO) which Retrieves multiple rows from a
Recordset object. To view the help, open a module then click help and search
for help on GetRows.

Having said this, usually I find it's easier to work with the recordset
itself - is it possible that you could just use a recordset?
 
J

JattilaB

Ok I found that and I have it working to some part but...

hoe can I tell it read a different table then the one I am currently working
with in my existing form?

I have the array the way I want it... but now I would like to refrence it to
another table besides the default one


make sense?
Sandra Daigle said:
Take a look at the GetRows Method (DAO) which Retrieves multiple rows from a
Recordset object. To view the help, open a module then click help and search
for help on GetRows.

Having said this, usually I find it's easier to work with the recordset
itself - is it possible that you could just use a recordset?

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

how can I read a tabel to an arry?
I would like to achive this wiht in a vb code inside the database...?
 
S

Sandra Daigle

You would open a recordset on the desired table - something like this:

dim db as dao.database
dim rst as dao.recordset
set db=currentdb()
set rst=db.openrecordset("Select Custid, CustName from tblCustomers;")
.. . .
'use the recordset
.. . .
rst.close
set rst=nothing
set db=nothing

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

Ok I found that and I have it working to some part but...

hoe can I tell it read a different table then the one I am currently
working with in my existing form?

I have the array the way I want it... but now I would like to
refrence it to another table besides the default one


make sense?
Sandra Daigle said:
Take a look at the GetRows Method (DAO) which Retrieves multiple
rows from a Recordset object. To view the help, open a module then
click help and search for help on GetRows.

Having said this, usually I find it's easier to work with the
recordset itself - is it possible that you could just use a
recordset?

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

how can I read a tabel to an arry?
I would like to achive this wiht in a vb code inside the
database...?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top