private sub command1_click()
dim cn as adodb.connection, rs as adodb.recordset
dim strfile as string, strpath as string
strpath = "e:\test\"
set cn = new adodb.connection
cn.open "provider=microsoft.jet.oledb.4.0;data source=" & strpath & "1.xls;extended properties=excel 8.0;"
set rs = cn.EXECute("select * from [sheet1$]")
strpath = "e:\test\1\"
do until rs.eof
strfile = dir(strpath & rs.fields("姓名") & ".jpg")
if strfile > "" then
name strpath & strfile as strpath & rs.fields("身份证号码") & ".jpg"
end if
rs.movenext
loop
set rs = nothing
cn.close
set cn = nothing
end sub