By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

Getting Data From / Adding Data To Access DB Table

P: n/a
I've looked at lots of solutions for this but I must say that I'm
thoroughly confused.

VB2005...

Let's say I've created a table in an access database called Table1
that has two columns and three records.

So the table looks like...

A 1
B 2
C 3

I want to get the data from that table into two arrays - a string
array and an integer array.

I've gone to the solution explorer, right click on project name, add
existing item, access_file.mdb, ...

In data sources I can see access_fileDataSet, and under that I can
see the table Table1. I can right click on Table1 and preview the
data. But I cannot for the life of me figure out how to get this into
an array.

Any help is greatly appreciated.

Oct 12 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"ags5406" <m_************@hotmail.comschrieb
I've looked at lots of solutions for this but I must say that I'm
thoroughly confused.

VB2005...

Let's say I've created a table in an access database called Table1
that has two columns and three records.

So the table looks like...

A 1
B 2
C 3

I want to get the data from that table into two arrays - a string
array and an integer array.

I've gone to the solution explorer, right click on project name, add
existing item, access_file.mdb, ...

In data sources I can see access_fileDataSet, and under that I can
see the table Table1. I can right click on Table1 and preview the
data. But I cannot for the life of me figure out how to get this
into an array.

Any help is greatly appreciated.

In short: Build a connection to the database, use an OleDbCommand and SQL
select command to query the data, use a OleDbDatareader to read the data in
a loop and put them into an array - but you should learn it from the start:
http://msdn2.microsoft.com/en-us/library/e80y5yhx.aspx
Armin

Oct 12 '07 #2

P: n/a
On Oct 12, 11:03 am, "Armin Zingler" <az.nos...@freenet.dewrote:
"ags5406" <m_cash_stra...@hotmail.comschrieb
I've looked at lots of solutions for this but I must say that I'm
thoroughly confused.
VB2005...
Let's say I've created a table in an access database called Table1
that has two columns and three records.
So the table looks like...
A 1
B 2
C 3
I want to get the data from that table into two arrays - a string
array and an integer array.
I've gone to the solution explorer, right click on project name, add
existing item, access_file.mdb, ...
In data sources I can see access_fileDataSet, and under that I can
see the table Table1. I can right click on Table1 and preview the
data. But I cannot for the life of me figure out how to get this
into an array.
Any help is greatly appreciated.

In short: Build a connection to the database, use an OleDbCommand and SQL
select command to query the data, use a OleDbDatareader to read the data in
a loop and put them into an array - but you should learn it from the start:http://msdn2.microsoft.com/en-us/library/e80y5yhx.aspx

Armin
Thank Armin - I'm already well on my way.

Oct 12 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.