Dim conn As Connection
Dim rs As Recordset
Set conn = New Connection
conn.Open "ROVIDER=SQLOLEDB;DATA SOURCE=(local);User ID=saassword=数据库密码;DataBase=数据库名称"
Set rs = New Recordset
rs.Open "select * from 表名", conn, 1, 1
For i = 1 To 3 '循环测试数据
'填入对应区域
rs.MoveNext
Next
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
|
|
快表帝国客服