Re: Getting Data From / Adding Data To Access DB Table

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"ags5406" <m_cash_stramel@xxxxxxxxxxx> schrieb
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

.



Relevant Pages

  • Re: Functions, Arrays and number/text stored as text
    ... May I request you to mail me the workbook at ask@xxxxxxxxxxxxxxxx and explain the problem very clealry. ... Table1 is basically a database holding hundreds of lines. ... everything in Column-A was numbers stored as numbers. ... number (IF/MAX array), etc. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: ADO conditional insert, update, or delete
    ... I have a multi-dimensional array and an Access database. ... MyArrayand MyArrayinto table1. ... Two saved queries are all ...
    (microsoft.public.scripting.vbscript)
  • Re: Remove items from GetRows array
    ... > I am pulling data from 3 tables. ... > table1 holds item details ... > I'm looping through the array to find duplicate records in the data I ... > through and pull out a column value to concatenate with the first ...
    (microsoft.public.inetserver.asp.general)
  • Functions, Arrays and number/text stored as text
    ... I have a small array problem. ... Let's call them Table1 and Table2. ... Table1 is basically a database holding hundreds of lines. ... To do this I used mostly VLOOKUPS and ARRAYS. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Functions, Arrays and number/text stored as text
    ... Let's call them Table1 and Table2. ... Table1 is basically a database holding hundreds of lines. ... To do this I used mostly VLOOKUPS and ARRAYS. ... number (IF/MAX array), etc. ...
    (microsoft.public.excel.worksheet.functions)