In both case the strategy is:
-Use ADO to open a connection to the SQL server.
-Open a recordset with the data the you want (using Tranaction SQL).
-Put the values into you excel sheet.
- Close the recordset and connection and destroy the objects.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
Sunja is Correct however i would change the process to:-
In both case the strategy is:
- Use ADO to open a connection to the SQL server.
- Open a Disconnected recordset with the data that you
want (using Tranaction SQL).
- Close and Release the Connection
- Put the values into you excel sheet.
- Close the recordset and destroy the objects.
Btw, I am working from VB6. When writing to Excel, would I be able to write cell by cell instead of column by column?
I supposed the code below writes column by column.
For i = 0 To 14
oRS.Fields(i).Value = oOrdersRS.Fields(i).Value
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.