|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Expot datas in to excel sheethow can i export the data which is returned in aquery intto an excel
sheet. Raja *** Sent via Developersdex http://www.developersdex.com *** <raja> wrote in message news:OJXr%23WlzFHA.1256@TK2MSFTNGP09.phx.gbl... Is Excel installed on the machine that will be running this code? And what > how can i export the data which is returned in aquery intto an excel > sheet. data access method are you using to run this "query"? DAO? ADO? On Tue, 11 Oct 2005 04:20:09 -0700, raja <raja> wrote:
¤ how can i export the data which is returned in aquery intto an excel ¤ sheet. ¤ What is the source of your data? Paul ~~~~ Microsoft MVP (Visual Basic) On Tue, 11 Oct 2005 22:59:27 -0700, raja <raja> wrote:
¤ ¤ sql Server2000 is the source ¤ raja See if the following works for you: Dim cnn As New ADODB.Connection Dim strSQL As String cnn.Open _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=e:\My Documents\Book200.xls;Extended Properties=Excel 8.0;" strSQL = "SELECT * INTO [Orders] FROM [Orders] IN '' [ODBC;Driver={SQL Server};Server=(local);Database=Northwind;Trusted_Connection=yes];" cnn.Execute strSQL cnn.Close Set cnn = Nothing Paul ~~~~ Microsoft MVP (Visual Basic) The source of my data is The SqlServer2000 (ADO)
raja *** Sent via Developersdex http://www.developersdex.com *** |
|||||||||||||||||||||||