Hi
I am trying to get data from sql server 2005 to excel.. I have written code in excel vba
Below is my code
Dim strConnection, conn, rs, strSQL
strConnection = "Provider=sqloledb;Data Source=LEON7269-G09\SQLEXPRESS;Initial Catalog=test;User Id=sa;Password=sa@123;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection
Set rs = Server.CreateObject("ADODB.recordset")
strSQL = "SELECT * FROM UserDetails"
rs.Open strSQL, conn, 3, 3
rs.MoveFirst
While Not rs.EOF
Response.Write (rs("myField") & "<br/>")
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
But i am getting error at line Set conn = Server.CreateObject("ADODB.Connection")
as runtime error 424
i have tried adding references in vba-->tools-->references but nothing is working ...Please guide me