需要先配置好ODBC,参考 Access数据库ODBC的配置
<%@ Language="JavaScript" codePage="65001" %>
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>在场车辆纪录</title>
<style type="text/css">
*{
color: white;
font: "楷体";
border-color: white;
}
td{
cursor: pointer;
}
#show_table td{
padding: 5px 5px 5px 5px;
border: 1px solid white;
line-height: 30px;
}
#show_table th{
border: 1px solid white;
line-height: 30px;
}
.ini_backgroud_color{
background-color: #0A1F30;
}
.select_true{
background-color: #1372CE;
}
#search_table td{
border: none;
}
#search_table input[type='text']{
color: #000000;
}
#search_table input[type='number']{
color: #000000;
}
#show_data table tr:hover{
background-color: #000000;
}
</style>
<script type="text/javascript" src="../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
function aa(){
$("tr:nth-child(odd)").addClass("ini_backgroud_color");
//隐藏小提示
$("#tip").hide();
$("#i_know").click(function(){
//隐藏小提示
sessionStorage.setItem("i_know","1");
$("#tip").hide();
});
//条件查询
$("#btn_search").click(function(){
var s = "";
if($("#Base_CardNo").val() != ""){
s=" and a.Base_CardNo"+" = '"+encodeURI($("#Base_CardNo").val().trim())+"'";
}
if($("#Base_PerName").val() != ""){
s =s+ " and c.Base_PerName= '"+encodeURI($("#Base_PerName").val().trim())+"'";
}
if($("#Vehicle_No").val() != ""){
s = s+" and a.Vehicle_No like'"+encodeURI("%"+$("#Vehicle_No").val()+"%")+"'";
}
if($("#start_time").val() != ""){
s = s +" and a.In_Datetime >convert(varchar(100),\'"+$("#start_time").val()+"\',25)";
}
if($("#end_time").val() != ""){
s = s +" and a.In_Datetime <= convert(varchar(100)