这应该是DAO连线方法,请问如何改写成ADO方法
Sub ABC()
Dim DB As Database
Dim RES As Recordset
Dim S As String
Connect$ = "ODBC;DSN=msndb;UID=eefg;PWD=a000user;"
Set DB = OpenDatabase("", False, False, Connect$)
Sheets("Sheet1").Select
S = " SELECT DTN FROM INDICES "
Set RES = DB.OpenRecordset(S, dbOpenSnapshot, dbSQLPassThrough)
Range("B8").CopyFromRecordset RES
End Sub
谢谢