dim cn,rs as object
dim strCon as string
dim sql as string
set cn=createobject("adodb.connection")
set rs=createobject("adodb.recordset")
strCon="provider=sqloledb;data source=127.0.0.1;uid=sa;pwd=123456;database=myData"
cn.open strCon
sql="selsect * from Table_1"
rs.open sql,cn,1,3
sheet1.range("a2").copyfromRecordset rs
rs.close
cn.close