R
Ralf Meuser
Hi there
I start understanding using the select statement to fillup my Excel sheet.
I do some thing like this:
..
Set objXL = WScript.CreateObject ("Excel.Application")
..
Set objWb2 = objXL.ActiveWorkBook.WorkSheets(1)
..
Dim cnn,rs,sql
Set cnn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cnn.Open "Provider=SQLOLEDB; Data Source=serveur3; Initial Catalog=my_db;
User ID=xxx;Password=yyy"
rs.Open "SELECT a,b,SUM(c) AS c1 From MYTABLE Where a=10 & " Group BY
a,b",cnn,3,3,&H0001
Do While Not rs.EOF
objWb2.Cells(i, 1) = rs("a")
objWb2.Cells(i, 2) = rs("b")
objWb2.Cells(i, 3) = rs("c1")
rs.MoveNext
i = i + 1
Loop
Now I would like to know if there is some like this for stored prodedures?
Thanks in dfavance for your help.
Best regards
Ralf
I start understanding using the select statement to fillup my Excel sheet.
I do some thing like this:
..
Set objXL = WScript.CreateObject ("Excel.Application")
..
Set objWb2 = objXL.ActiveWorkBook.WorkSheets(1)
..
Dim cnn,rs,sql
Set cnn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cnn.Open "Provider=SQLOLEDB; Data Source=serveur3; Initial Catalog=my_db;
User ID=xxx;Password=yyy"
rs.Open "SELECT a,b,SUM(c) AS c1 From MYTABLE Where a=10 & " Group BY
a,b",cnn,3,3,&H0001
Do While Not rs.EOF
objWb2.Cells(i, 1) = rs("a")
objWb2.Cells(i, 2) = rs("b")
objWb2.Cells(i, 3) = rs("c1")
rs.MoveNext
i = i + 1
Loop
Now I would like to know if there is some like this for stored prodedures?
Thanks in dfavance for your help.
Best regards
Ralf