Solved

DataGrid data to an array

Posted on 2000-04-20
5
165 Views
Last Modified: 2010-05-02
I use an ACCESS database recordset to store columns of numbers that I would like to plot on an x-y chart in a VB program. I can pull the data easily into my VB program using DataGrid and display it on the screen.
What I'd like to do with the data is select two columns and put that data into a two dimensional array so I can plot the data on an x-y chart. It seems like there should be an easy way to do this but I'm getting nowhere. Any solutions??
BOB
0
Comment
Question by:rafox
  • 2
  • 2
5 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 2735587
Take a look at the GetRows method (of the ADO object).
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 2735604
Take a look at the GetRows method of the ADO recordset object.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2736012
you might consider creating a udt rather than a two dimensional array, e.g.

Private Type coords
   x As Variant
   y As Variant
End Type
0
 

Author Comment

by:rafox
ID: 2736538
emoreau--
GetRows works -- I was looking for something from DataGrid but as long as I can get the data into the arrays, I'm OK.

BOB



AzraSound--
Is there any advantage to using a udt as you suggested when using the data in an XY plot using MSChart Control. How would I use it?

BOB
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2736626
no not really other than the fact you dont have to work with two dimensional arrays.  If that isnt a bother to you then there really is no need to go with the udt's.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now