Solved

DataGrid data to an array

Posted on 2000-04-20
5
166 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 70

Accepted Solution

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using Access 8 68
using web browser with BING 40 120
Create Files based on Cell Values in a Range in Excel 12 39
RUNRMTCMD from AS/400 12 47
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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