Dim cnn,strSql Set cnn = CreateObject("adodb.connection") cnn.Open "driver={sql server};server=10.2.*.1;uid=xiaoming;database=DBprod;pwd=123456" strSQL = "select top 10 * from usertable " Sheets("TEST1").Range("a2").CopyFromRecordset cnn.Execute(strSQL)
时间: 2024-10-10 17:34:10