Hi
I'm a VB programmer and I ussaly access my files through ODBC driver using ADODB recordset and SQL statements. I want to export the result of thew sql request in Excel format. How can I do it ?
Helping me = Saving me
Thanx
CU
Printable View
Hi
I'm a VB programmer and I ussaly access my files through ODBC driver using ADODB recordset and SQL statements. I want to export the result of thew sql request in Excel format. How can I do it ?
Helping me = Saving me
Thanx
CU
You have 2 choices :
Choice 1 : Comma-Delimited
Export it as a text file with commas seperating your data elements.
Excel can read these files and place them into their appropriate columns but this is only good for raw data.
Choice 2 : True XLS Format
To do this you need to connect to the excel object (Look up CreateObject) and to control it as if you were constructing your own excel file using VB macros.
This is a lengthy process and requires you to know VBA quite well for Excel. It will also load Excel into the background (ie cannot see in task bar but can see in Task Manager) and has the occational tendancy to go wrong.