VBS 连接access 数据库
'
Dim conn,rs,sqlstr
Set conn = CreateObject(“ADODB.Connection”)
conn.connectionstring = “provider=microsoft.jet.oledb.4.0;data source=db1.mdb”
conn.open
Set rs = CreateObject(“ADODB.RecordSet”)
sqlstr = “Select top 1 * from table1”
rs.open sqlstr,conn,1,1
do while not rs.eof
msgbox rs(“field2”)
rs.movenext
loop
rs.close
Set rs = nothing
conn.close
Set conn = nothing
msgbox “完毕”
'