<% '数据库名称 dbname = "xxx.dbf" Driver = "Driver={Microsoft Visual FoxPro Driver};" SourceType = "SourceType=DBF;" DBPath = "SourceDB=" & Server.MapPath(dbname) connstr = Driver & SourceType & DBPath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open connstr sub CloseConn() Conn.close set Conn=nothing end sub '----------------------------------------conn.asp---------------------------------------- xm="张三" sfzh="123456" sql="select * from xxx.dbf where 姓名='"&xm&"' and 身份证号='"&sfzh&"'" Set RS = Conn.Execute(sql) if rs.bof or rs.eof then response.write "没有数据" end if do while not rs.eof response.write rs(0)&" "&rs(1)&" "&rs(2)&" "&rs(3)&" "&rs(4)&" "&rs(5)&" "&rs(6)&" "&rs(7)&" "&rs(8)&" <br>" rs.movenext loop rs.close set rs=nothing call CloseConn() %>