ADO Newbie questons

D

Dave F

Hi
This is my first attempt at ADO.
I'm using AutoCAD 2002, Excel '97 & 2000 & ADO 2.5

I'm trying to transfer some excel work book info into a listbox in a form
within AutoCAD.
I'm trying to do it without opening the .xls file using adaptation of the
routines listed here:
http://www.erlandsendata.no/english/index.php?d=envbadacimportwbado

I tested transferring the info into another excel worksheet with no problems
but I don't know how to transfer into a listbox.

Can I use CopyFrom Recordset or is GetRows the only options

Any ideas?

Can I use ADO with excel '97?

If not, is DAO an alternative?

Thanks in advance.

Dave F.
 
S

SA

Dave:

1.) If you use the provider for Excel as in the example, it will work on
Excel 97 workbooks as well as later versions of Excel.
2.) Once you get a row set of data, its best to use GetRows to place the
data into an array; GetRows is fast and efficient, you simply need to make
sure that you specify a size that is large enough to accomodate all the rows
returned.
3.) While not having used AutoCad so am not familiar with what ever type of
forms support they have there. If AutoCad has integrated VBA and Visual
Basic forms, then the way to load the list into your list box is to use the
array returned by GetRows.

Once you set the list box to have as many columns as your data contains, and
you have the data in an array then with VB forms its as simple as:

Me.YourListBoxName.List = arrDataArrayFromGetRows()

HTH
 

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