Forum Moderators: open

Message Too Old, No Replies

Outputtin VB ADODB recordset to excel and text

I need to export a recordset to Excel

         

MoTheLondoner

9:11 am on Jun 28, 2005 (gmt 0)



Hi,

I am a bit of a beginner in VB6, but I have got to a stage where I am working with adodb recordsets. I have created a recordset that i need to export to excel. Can someone tell me how to do this. Treat me as dumb as possible and explain everything I need to know please. I heard I need to create a data class and refer to it, but this is oh soooooo confusing.

Cheers

giggle

9:33 am on Jun 28, 2005 (gmt 0)

10+ Year Member



I offered some code here [webmasterworld.com], it might help get you started.

sullen

9:41 am on Jun 28, 2005 (gmt 0)

10+ Year Member



does the syestem have to actually open excel?

If not it would be easier to create a csv file and then import that into Excel. (I won't go into details in case it's not at all a good solution, but search on Scripting.FileSystemObject for creating a file and then just output each field with whichever delimiter you feel fit).

wingnut

7:31 pm on Jun 29, 2005 (gmt 0)

10+ Year Member



If you can create an asp page to render the data from a db then all you need is one line of code at the top of that page.

See [aspalliance.com...]

andrevr

11:34 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



Wingnut, I have to say, that's really elegant :)

If you need to you can open and edit Excel sheets with SQL statements using an ADO connection. The link points to the first page of a Delphi article, but the principle is the same for ASP.

[delphi.about.com...]

Hope it helps...